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:
@ -449,12 +449,12 @@ Position? _goUp(EditorState editorState) {
|
|||||||
final rect = rects.reduce(
|
final rect = rects.reduce(
|
||||||
(current, next) => current.bottom >= next.bottom ? current : next,
|
(current, next) => current.bottom >= next.bottom ? current : next,
|
||||||
);
|
);
|
||||||
offset = rect.topRight.translate(0, -rect.height);
|
offset = rect.center.translate(0, -rect.height);
|
||||||
} else {
|
} else {
|
||||||
final rect = rects.reduce(
|
final rect = rects.reduce(
|
||||||
(current, next) => current.top <= next.top ? current : next,
|
(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);
|
return editorState.service.selectionService.getPositionInOffset(offset);
|
||||||
}
|
}
|
||||||
@ -470,12 +470,12 @@ Position? _goDown(EditorState editorState) {
|
|||||||
final rect = rects.reduce(
|
final rect = rects.reduce(
|
||||||
(current, next) => current.bottom >= next.bottom ? current : next,
|
(current, next) => current.bottom >= next.bottom ? current : next,
|
||||||
);
|
);
|
||||||
offset = rect.bottomRight.translate(0, rect.height);
|
offset = rect.center.translate(0, rect.height);
|
||||||
} else {
|
} else {
|
||||||
final rect = rects.reduce(
|
final rect = rects.reduce(
|
||||||
(current, next) => current.top <= next.top ? current : next,
|
(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);
|
return editorState.service.selectionService.getPositionInOffset(offset);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user