cursor position setting

This commit is contained in:
Allen Webster 2016-07-06 21:41:37 -04:00
parent 611f270410
commit 3ec19cfae3
4 changed files with 5 additions and 2 deletions

View File

@ -705,6 +705,7 @@ write_string(Application_Links *app, String string){
app->buffer_replace_range(app, &buffer, app->buffer_replace_range(app, &buffer,
view.cursor.pos, view.cursor.pos, view.cursor.pos, view.cursor.pos,
string.str, string.size); string.str, string.size);
app->view_set_cursor(app, &view, seek_pos(view.cursor.pos + string.size), true);
} }
CUSTOM_COMMAND_SIG(write_increment){ CUSTOM_COMMAND_SIG(write_increment){

View File

@ -468,6 +468,7 @@ COMMAND_DECL(word_complete){
if (search_hit_add(general, &complete_state->hits, &complete_state->str, spare, match_size)){ if (search_hit_add(general, &complete_state->hits, &complete_state->str, spare, match_size)){
view_replace_range(system, models, view, word_start, word_end, spare, match_size); view_replace_range(system, models, view, word_start, word_end, spare, match_size);
view_cursor_move(view, word_start + match_size);
complete_state->word_end = word_start + match_size; complete_state->word_end = word_start + match_size;
complete_state->set.ranges[1].start = word_start + match_size; complete_state->set.ranges[1].start = word_start + match_size;
@ -486,6 +487,7 @@ COMMAND_DECL(word_complete){
match_size = complete_state->iter.word.size; match_size = complete_state->iter.word.size;
view_replace_range(system, models, view, word_start, word_end, view_replace_range(system, models, view, word_start, word_end,
complete_state->iter.word.str, match_size); complete_state->iter.word.str, match_size);
view_cursor_move(view, word_start + match_size);
complete_state->word_end = word_start + match_size; complete_state->word_end = word_start + match_size;
complete_state->set.ranges[1].start = word_start + match_size; complete_state->set.ranges[1].start = word_start + match_size;

View File

@ -1,4 +1,4 @@
Distribution Date: 5.7.2016 (dd.mm.yyyy) Distribution Date: 6.7.2016 (dd.mm.yyyy)
Thank you for contributing to the 4coder project! Thank you for contributing to the 4coder project!

View File

@ -1,4 +1,4 @@
Distribution Date: 5.7.2016 (dd.mm.yyyy) Distribution Date: 6.7.2016 (dd.mm.yyyy)
Thank you for contributing to the 4coder project! Thank you for contributing to the 4coder project!