adding goCodeHome and goCodeEnd to use ctrl+home and ctrl+end in the code editor
This commit is contained in:
parent
f00221705b
commit
29abca5e3f
|
@ -2,6 +2,8 @@
|
|||
*.ipch
|
||||
*.opendb
|
||||
*.suo
|
||||
sexit
|
||||
.vscode/
|
||||
build/uwp/tic/Debug/
|
||||
build/uwp/tic/Release/
|
||||
build/uwp/tic/x64/
|
||||
|
|
16
src/code.c
16
src/code.c
|
@ -619,6 +619,20 @@ static void goEnd(Code* code)
|
|||
updateColumn(code);
|
||||
}
|
||||
|
||||
static void goCodeHome(Code *code)
|
||||
{
|
||||
code->cursor.position = code->data;
|
||||
|
||||
updateColumn(code);
|
||||
}
|
||||
|
||||
static void goCodeEnd(Code *code)
|
||||
{
|
||||
code->cursor.position = code->data + strlen(code->data);
|
||||
|
||||
updateColumn(code);
|
||||
}
|
||||
|
||||
static void pageUp(Code* code)
|
||||
{
|
||||
s32 column = 0;
|
||||
|
@ -1228,6 +1242,8 @@ static void processKeydown(Code* code, SDL_Keycode keycode)
|
|||
case SDLK_g: setCodeMode(code, TEXT_GOTO_MODE); break;
|
||||
case SDLK_o: setCodeMode(code, TEXT_OUTLINE_MODE); break;
|
||||
case SDLK_SLASH: commentLine(code); break;
|
||||
case SDLK_HOME: goCodeHome(code); break;
|
||||
case SDLK_END: goCodeEnd(code); break;
|
||||
}
|
||||
}
|
||||
else if(keymod & KMOD_ALT)
|
||||
|
|
Loading…
Reference in New Issue