mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: [Bug] Code block jump skip blank line
This commit is contained in:
parent
90da54d12f
commit
5a252bcb18
@ -449,12 +449,12 @@ Position? _goUp(EditorState editorState) {
|
||||
final rect = rects.reduce(
|
||||
(current, next) => current.bottom >= next.bottom ? current : next,
|
||||
);
|
||||
offset = rect.topRight.translate(0, -rect.height);
|
||||
offset = rect.center.translate(0, -rect.height);
|
||||
} else {
|
||||
final rect = rects.reduce(
|
||||
(current, next) => current.top <= next.top ? current : next,
|
||||
);
|
||||
offset = rect.topLeft.translate(0, -rect.height);
|
||||
offset = rect.center.translate(0, -rect.height);
|
||||
}
|
||||
return editorState.service.selectionService.getPositionInOffset(offset);
|
||||
}
|
||||
@ -470,12 +470,12 @@ Position? _goDown(EditorState editorState) {
|
||||
final rect = rects.reduce(
|
||||
(current, next) => current.bottom >= next.bottom ? current : next,
|
||||
);
|
||||
offset = rect.bottomRight.translate(0, rect.height);
|
||||
offset = rect.center.translate(0, rect.height);
|
||||
} else {
|
||||
final rect = rects.reduce(
|
||||
(current, next) => current.top <= next.top ? current : next,
|
||||
);
|
||||
offset = rect.bottomLeft.translate(0, rect.height);
|
||||
offset = rect.center.translate(0, rect.height);
|
||||
}
|
||||
return editorState.service.selectionService.getPositionInOffset(offset);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user