This commit is contained in:
Krzosa Karol
2024-07-22 10:36:53 +02:00
parent c2b2c2a6ae
commit ce20a1d940
2 changed files with 8 additions and 2 deletions

View File

@@ -28,7 +28,6 @@
/*
- Ctrl + D - create new cursor at next occurence of word
- Scrollbars
- Line numbers
- file info bar at bottom (line, column, line endings)
- Colored strings

View File

@@ -231,6 +231,13 @@ void HandleKeybindings(View *_view) {
Command_Replace(&view, L"");
}
bool dont_update_scroll = false;
if (CtrlPress(KEY_A)) {
view.carets.len = 1;
view.carets[0] = MakeCaret(0, view.buffer->len);
dont_update_scroll = true;
}
if (ShiftPress(KEY_PAGE_UP)) {
Command_MoveCursorsByPageSize(&view, DIR_UP, SHIFT_PRESSED);
} else if (Press(KEY_PAGE_UP)) {
@@ -362,7 +369,7 @@ void HandleKeybindings(View *_view) {
}
// Scrolling with caret
if (!AreEqual(main_caret_on_begin_frame, view.carets[0])) {
if (!AreEqual(main_caret_on_begin_frame, view.carets[0]) && !dont_update_scroll) {
Caret c = view.carets[0];
Int front = GetFront(c);
XY xy = PosToXY(buf, front);