Fix first build error navigation
This commit is contained in:
@@ -45,7 +45,7 @@ BSet ExecBuild(String windows_cmd, String unix_cmd, String working_dir = Project
|
||||
Exec(args);
|
||||
}
|
||||
main.window->active_goto_list = build.view->id;
|
||||
main.window->goto_list_pos = 0;
|
||||
main.window->goto_list_pos = -1;
|
||||
build.window->visible = true;
|
||||
return build;
|
||||
}
|
||||
|
||||
@@ -274,10 +274,16 @@ void GotoNextInList(Window *window, Int line_offset = 1) {
|
||||
|
||||
Buffer *buffer_goto = GetBuffer(view_goto->active_buffer);
|
||||
int64_t pos = window->goto_list_pos;
|
||||
Int line = PosToLine(buffer_goto, pos);
|
||||
Int start_line = 0;
|
||||
if (pos < 0) {
|
||||
start_line = line_offset > 0 ? 0 : buffer_goto->line_starts.len - 1;
|
||||
} else {
|
||||
Int line = PosToLine(buffer_goto, pos);
|
||||
start_line = line + line_offset;
|
||||
}
|
||||
|
||||
bool opened = false;
|
||||
for (Int i = line + line_offset; i >= 0 && i < buffer_goto->line_starts.len; i += line_offset) {
|
||||
for (Int i = start_line; i >= 0 && i < buffer_goto->line_starts.len; i += line_offset) {
|
||||
Range line_range = GetLineRangeWithoutNL(buffer_goto, i);
|
||||
String16 string_line = GetString(buffer_goto, line_range);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user