aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJurica Bradarić <jbradaric@users.noreply.github.com>2016-09-04 23:40:12 +0200
committerJustin M. Keyes <justinkz@gmail.com>2016-09-04 23:40:12 +0200
commit0f381f26cbbe7f50de106c996d8a9d946db61574 (patch)
treedcb9b4c8f80599ddb49b4f44e58319cf20724434 /src/nvim/quickfix.c
parente75e9c10dc947bc4aac0aea927e47038bf984b7f (diff)
downloadrneovim-0f381f26cbbe7f50de106c996d8a9d946db61574.tar.gz
rneovim-0f381f26cbbe7f50de106c996d8a9d946db61574.tar.bz2
rneovim-0f381f26cbbe7f50de106c996d8a9d946db61574.zip
vim-patch:7.4.1971 (#5262)
Problem: It is not easy to see unrecognized error lines below the current error position. Solution: Add ":clist +count". https://github.com/vim/vim/commit/e8fea0728a2fa1fe78ef0ac90dee1a84bd7ef9fb
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 20bd0a62b8..2a3cdfa790 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1732,15 +1732,29 @@ void qf_list(exarg_T *eap)
EMSG(_(e_quickfix));
return;
}
+
+ bool plus = false;
+ if (*arg == '+') {
+ arg++;
+ plus = true;
+ }
if (!get_list_range(&arg, &idx1, &idx2) || *arg != NUL) {
EMSG(_(e_trailing));
return;
}
- i = qi->qf_lists[qi->qf_curlist].qf_count;
- if (idx1 < 0)
- idx1 = (-idx1 > i) ? 0 : idx1 + i + 1;
- if (idx2 < 0)
- idx2 = (-idx2 > i) ? 0 : idx2 + i + 1;
+ if (plus) {
+ i = qi->qf_lists[qi->qf_curlist].qf_index;
+ idx2 = i + idx1;
+ idx1 = i;
+ } else {
+ i = qi->qf_lists[qi->qf_curlist].qf_count;
+ if (idx1 < 0) {
+ idx1 = (-idx1 > i) ? 0 : idx1 + i + 1;
+ }
+ if (idx2 < 0) {
+ idx2 = (-idx2 > i) ? 0 : idx2 + i + 1;
+ }
+ }
if (qi->qf_lists[qi->qf_curlist].qf_nonevalid)
all = TRUE;