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 - Ctrl + D - create new cursor at next occurence of word
- Scrollbars
- Line numbers - Line numbers
- file info bar at bottom (line, column, line endings) - file info bar at bottom (line, column, line endings)
- Colored strings - Colored strings

View File

@@ -231,6 +231,13 @@ void HandleKeybindings(View *_view) {
Command_Replace(&view, L""); 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)) { if (ShiftPress(KEY_PAGE_UP)) {
Command_MoveCursorsByPageSize(&view, DIR_UP, SHIFT_PRESSED); Command_MoveCursorsByPageSize(&view, DIR_UP, SHIFT_PRESSED);
} else if (Press(KEY_PAGE_UP)) { } else if (Press(KEY_PAGE_UP)) {
@@ -362,7 +369,7 @@ void HandleKeybindings(View *_view) {
} }
// Scrolling with caret // 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]; Caret c = view.carets[0];
Int front = GetFront(c); Int front = GetFront(c);
XY xy = PosToXY(buf, front); XY xy = PosToXY(buf, front);