diff options
author | Jurica Bradarić <jbradaric@users.noreply.github.com> | 2016-09-04 23:40:12 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-09-04 23:40:12 +0200 |
commit | 0f381f26cbbe7f50de106c996d8a9d946db61574 (patch) | |
tree | dcb9b4c8f80599ddb49b4f44e58319cf20724434 | |
parent | e75e9c10dc947bc4aac0aea927e47038bf984b7f (diff) | |
download | rneovim-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
-rw-r--r-- | runtime/doc/quickfix.txt | 18 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 24 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 36 insertions, 8 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 3b54faf18e..e2a44541ae 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.4. Last change: 2016 Mar 19 +*quickfix.txt* For Vim version 7.4. Last change: 2016 Jul 01 VIM REFERENCE MANUAL by Bram Moolenaar @@ -259,9 +259,23 @@ location list command, it will be aborted. The 'switchbuf' settings are respected when jumping to a buffer. +:cl[ist] +{count} List the current and next {count} valid errors. This + is similar to ":clist from from+count", where "from" + is the current error position. + :cl[ist]! [from] [, [to]] List all errors. +:cl[ist]! +{count} List the current and next {count} error lines. This + is useful to see unrecognized lines after the current + one. For example, if ":clist" shows: + 8384 testje.java:252: error: cannot find symbol ~ + Then using ":cl! +3" shows the reason: + 8384 testje.java:252: error: cannot find symbol ~ + 8385: ZexitCode = Fmainx(); ~ + 8386: ^ ~ + 8387: symbol: method Fmainx() ~ + *:lli* *:llist* :lli[st] [from] [, [to]] Same as ":clist", except the location list for the @@ -306,7 +320,7 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: etc. < When the current file can't be |abandon|ed and the [!] is not present, the command fails. - When an error is detected excecution stops. + When an error is detected execution stops. The last buffer (or where an error occurred) becomes the current buffer. {cmd} can contain '|' to concatenate several commands. 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; diff --git a/src/nvim/version.c b/src/nvim/version.c index d37eec1c28..7ce9df4c6e 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -305,7 +305,7 @@ static int included_patches[] = { // 1974 NA 1973, // 1972, - // 1971, + 1971, // 1970, // 1969 NA // 1968, |