summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-12-29 20:36:16 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-12-29 20:36:16 -0500
commit51837743b0f90973bf63582a8f34662e9677629e (patch)
treefee7d2dd0b3be97c2ff678b56e5564549b6ca7fd /main.c
parentad9dfcbc8542fa478d9afbfb13a953b6da8186c7 (diff)
Home and end
Diffstat (limited to 'main.c')
-rw-r--r--main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/main.c b/main.c
index b115196..325c7b2 100644
--- a/main.c
+++ b/main.c
@@ -217,6 +217,36 @@ int main(void) {
}
}
break;
+ case SDLK_HOME:
+ if (ctrl) {
+ if (shift) {
+ buffer_select_to_start_of_file(buffer);
+ } else {
+ buffer_cursor_move_to_start_of_file(buffer);
+ }
+ } else {
+ if (shift) {
+ buffer_select_to_start_of_line(buffer);
+ } else {
+ buffer_cursor_move_to_start_of_line(buffer);
+ }
+ }
+ break;
+ case SDLK_END:
+ if (ctrl) {
+ if (shift) {
+ buffer_select_to_end_of_file(buffer);
+ } else {
+ buffer_cursor_move_to_end_of_file(buffer);
+ }
+ } else {
+ if (shift) {
+ buffer_select_to_end_of_line(buffer);
+ } else {
+ buffer_cursor_move_to_end_of_line(buffer);
+ }
+ }
+ break;
}
} break;
case SDL_TEXTINPUT: {