white_or_token seeks fixed, tweaks to mark

This commit is contained in:
Allen Webster 2016-02-25 00:01:25 -05:00
parent dca0269d8e
commit 3a03c6dbb0
3 changed files with 10 additions and 10 deletions

View File

@ -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")){

12
4ed.cpp
View File

@ -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){

View File

@ -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);