aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 3abf43cb8c..f3abf864fb 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1606,13 +1606,12 @@ win_found:
}
if (qf_ptr->qf_col > 0) {
curwin->w_cursor.col = qf_ptr->qf_col - 1;
- if (qf_ptr->qf_viscol == TRUE) {
- /*
- * Check each character from the beginning of the error
- * line up to the error column. For each tab character
- * found, reduce the error column value by the length of
- * a tab character.
- */
+ curwin->w_cursor.coladd = 0;
+ if (qf_ptr->qf_viscol == true) {
+ // Check each character from the beginning of the error
+ // line up to the error column. For each tab character
+ // found, reduce the error column value by the length of
+ // a tab character.
line = get_cursor_line_ptr();
screen_col = 0;
for (char_col = 0; char_col < curwin->w_cursor.col; ++char_col) {
@@ -2117,14 +2116,10 @@ void ex_copen(exarg_T *eap)
prevwin = win;
}
- /*
- * Fill the buffer with the quickfix list.
- */
- qf_fill_buffer(qi);
+ qf_set_title_var(qi);
- if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) {
- qf_set_title_var(qi);
- }
+ // Fill the buffer with the quickfix list.
+ qf_fill_buffer(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0;
@@ -2256,16 +2251,13 @@ static void qf_update_buffer(qf_info_T *qi)
/* set curwin/curbuf to buf and save a few things */
aucmd_prepbuf(&aco, buf);
- qf_fill_buffer(qi);
-
- if (qi->qf_lists[qi->qf_curlist].qf_title != NULL
- && (win = qf_find_win(qi)) != NULL) {
+ if ((win = qf_find_win(qi)) != NULL) {
curwin_save = curwin;
curwin = win;
qf_set_title_var(qi);
curwin = curwin_save;
-
}
+ qf_fill_buffer(qi);
/* restore curwin/curbuf and a few other things */
aucmd_restbuf(&aco);
@@ -2274,10 +2266,13 @@ static void qf_update_buffer(qf_info_T *qi)
}
}
+// Set "w:quickfix_title" if "qi" has a title.
static void qf_set_title_var(qf_info_T *qi)
{
- set_internal_string_var((char_u *)"w:quickfix_title",
- qi->qf_lists[qi->qf_curlist].qf_title);
+ if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) {
+ set_internal_string_var((char_u *)"w:quickfix_title",
+ qi->qf_lists[qi->qf_curlist].qf_title);
+ }
}
/*