diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-10-26 01:17:21 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-10-25 22:17:21 -0700 |
commit | 0b771cd9aabfdee3ddc14c08af076f5df5cd0150 (patch) | |
tree | 04a136eaf6f5fe81c04e2bc28dba30a9a11a81f5 /src/nvim/quickfix.c | |
parent | 99aa166cb105cb33df7bb153e93f15b509fcbc8c (diff) | |
download | rneovim-0b771cd9aabfdee3ddc14c08af076f5df5cd0150.tar.gz rneovim-0b771cd9aabfdee3ddc14c08af076f5df5cd0150.tar.bz2 rneovim-0b771cd9aabfdee3ddc14c08af076f5df5cd0150.zip |
vim-patch:8.1.0859: handle multibyte "%v" in 'errorformat' #11285
Problem: "%v" in 'errorformat' does handle multi-byte characters.
Solution: Handle multi-byte characters. (Yegappan Lakshmanan, closes vim/vim#3700)
https://github.com/vim/vim/commit/c45eb770a5988734ff2c572e5e2ce307158c33c8
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index ec32a88f79..b951773860 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2437,9 +2437,6 @@ static void qf_jump_goto_line(linenr_T qf_lnum, int qf_col, char_u qf_viscol, char_u *qf_pattern) { linenr_T i; - char_u *line; - colnr_T screen_col; - colnr_T char_col; if (qf_pattern == NULL) { // Go to line with error, unless qf_lnum is 0. @@ -2451,26 +2448,11 @@ static void qf_jump_goto_line(linenr_T qf_lnum, int qf_col, char_u qf_viscol, curwin->w_cursor.lnum = i; } if (qf_col > 0) { - curwin->w_cursor.col = qf_col - 1; curwin->w_cursor.coladd = 0; if (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++) { - if (*line == NUL) { - break; - } - if (*line++ == '\t') { - curwin->w_cursor.col -= 7 - (screen_col % 8); - screen_col += 8 - (screen_col % 8); - } else { - screen_col++; - } - } + coladvance(qf_col - 1); + } else { + curwin->w_cursor.col = qf_col - 1; } curwin->w_set_curswant = true; check_cursor(); |