From 3a03c6dbb0e176747bf2126aec094d58f4394a6d Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 25 Feb 2016 00:01:25 -0500 Subject: [PATCH] white_or_token seeks fixed, tweaks to mark --- 4coder_custom.cpp | 4 ++-- 4ed.cpp | 12 ++++++------ 4ed_file_view.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/4coder_custom.cpp b/4coder_custom.cpp index ab4ec837..090e3d71 100644 --- a/4coder_custom.cpp +++ b/4coder_custom.cpp @@ -348,7 +348,7 @@ CUSTOM_COMMAND_SIG(build_search){ // - par_cli_overlap_with_conflict: whether to launch this process if an existing process // is already being used for output on the same buffer // - // - par_target_buffer_name: the name of the buffer to fill with the output from the process + // - par_name: the name of the buffer to fill with the output from the process // // - par_cli_path: sets the path from which the command is executed // @@ -370,7 +370,7 @@ CUSTOM_COMMAND_SIG(build_search){ while (keep_going){ if (app->directory_has_file(dir, "build.bat")){ push_parameter(app, cmd_context, par_cli_overlap_with_conflict, 0); - push_parameter(app, cmd_context, par_target_buffer_name, literal("*compilation*")); + push_parameter(app, cmd_context, par_name, literal("*compilation*")); push_parameter(app, cmd_context, par_cli_path, dir.str, dir.size); if (append(&dir, "build")){ diff --git a/4ed.cpp b/4ed.cpp index dbf7b948..05cabe30 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -347,35 +347,35 @@ COMMAND_DECL(seek_token_right){ } COMMAND_DECL(seek_white_or_token_right){ -#if BUFFER_EXPERIMENT_SCALPEL <= 0 ProfileMomentFunction(); REQ_FILE_VIEW(view); REQ_FILE(file, view); i32 token_pos, white_pos; - token_pos = file->state.buffer.size; if (file->state.tokens_complete){ token_pos = seek_token_right(&file->state.token_stack, view->cursor.pos); } + else{ + token_pos = buffer_size(&file->state.buffer); + } white_pos = buffer_seek_whitespace_right(&file->state.buffer, view->cursor.pos); view_cursor_move(view, Min(token_pos, white_pos)); -#endif } COMMAND_DECL(seek_white_or_token_left){ -#if BUFFER_EXPERIMENT_SCALPEL <= 0 ProfileMomentFunction(); REQ_FILE_VIEW(view); REQ_FILE(file, view); i32 token_pos, white_pos; - token_pos = file->state.buffer.size; if (file->state.tokens_complete){ token_pos = seek_token_left(&file->state.token_stack, view->cursor.pos); } + else{ + token_pos = 0; + } white_pos = buffer_seek_whitespace_left(&file->state.buffer, view->cursor.pos); view_cursor_move(view, Max(token_pos, white_pos)); -#endif } COMMAND_DECL(seek_alphanumeric_right){ diff --git a/4ed_file_view.cpp b/4ed_file_view.cpp index 954cb63b..031e5afe 100644 --- a/4ed_file_view.cpp +++ b/4ed_file_view.cpp @@ -1770,7 +1770,7 @@ file_edit_cursor_fix(System_Functions *system, if (current_view && current_view->file == file){ view_measure_wraps(system, general, current_view); write_cursor_with_index(cursors, &cursor_count, current_view->cursor.pos); - write_cursor_with_index(cursors, &cursor_count, current_view->mark); + write_cursor_with_index(cursors, &cursor_count, current_view->mark - 1); write_cursor_with_index(cursors, &cursor_count, current_view->scroll_i - 1); } } @@ -1797,7 +1797,7 @@ file_edit_cursor_fix(System_Functions *system, view_cursor_move(current_view, cursors[cursor_count++].pos); current_view->preferred_x = view_get_cursor_x(current_view); - current_view->mark = cursors[cursor_count++].pos; + current_view->mark = cursors[cursor_count++].pos + 1; current_view->scroll_i = cursors[cursor_count++].pos + 1; temp_cursor = view_compute_cursor_from_pos(current_view, current_view->scroll_i); y_offset = MOD(current_view->scroll_y, current_view->font_height);