diff options
author | pommicket <pommicket@gmail.com> | 2023-08-15 11:00:00 -0300 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-15 11:31:06 -0300 |
commit | ad8c5d1466eb8edf2e6343f28026ae993ac31f2c (patch) | |
tree | b4a9d475b47cc978c66d830ea61a99c0464af9f8 /command.c | |
parent | 4ea381d6a8a2a560213de896bab2aad02a70f937 (diff) |
use home/end with selector
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -259,11 +259,13 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen autocomplete_close(ted); break; case CMD_START_OF_LINE: - if (buffer) buffer_cursor_move_to_start_of_line(buffer); + if (ted->selector_open) selector_home(ted, ted->selector_open); + else if (buffer) buffer_cursor_move_to_start_of_line(buffer); autocomplete_close(ted); break; case CMD_END_OF_LINE: - if (buffer) buffer_cursor_move_to_end_of_line(buffer); + if (ted->selector_open) selector_end(ted, ted->selector_open); + else if (buffer) buffer_cursor_move_to_end_of_line(buffer); autocomplete_close(ted); break; case CMD_SELECT_START_OF_LINE: @@ -275,11 +277,13 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen autocomplete_close(ted); break; case CMD_START_OF_FILE: - if (buffer) buffer_cursor_move_to_start_of_file(buffer); + if (ted->selector_open) selector_home(ted, ted->selector_open); + else if (buffer) buffer_cursor_move_to_start_of_file(buffer); autocomplete_close(ted); break; case CMD_END_OF_FILE: - if (buffer) buffer_cursor_move_to_end_of_file(buffer); + if (ted->selector_open) selector_end(ted, ted->selector_open); + else if (buffer) buffer_cursor_move_to_end_of_file(buffer); autocomplete_close(ted); break; case CMD_SELECT_START_OF_FILE: |