aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2017-07-16 14:23:56 +0200
committerJurica Bradaric <jbradaric@gmail.com>2017-07-16 17:48:50 +0200
commit33efad7dbc26750486d1910157345c508684125e (patch)
tree3a568317f21577c928268f99a2358120ef96c74e /src/nvim/quickfix.c
parent4dee942e732d41ad62b732c0a39719d9405bc928 (diff)
downloadrneovim-33efad7dbc26750486d1910157345c508684125e.tar.gz
rneovim-33efad7dbc26750486d1910157345c508684125e.tar.bz2
rneovim-33efad7dbc26750486d1910157345c508684125e.zip
vim-patch:8.0.0017
Problem: Cannot get the number of the current quickfix or location list. Solution: Use the current list if "nr" in "what" is zero. (Yegappan Lakshmanan) Remove debug command from test. https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index bd5dfa92cc..6797632008 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -4025,9 +4025,12 @@ int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
if ((di = tv_dict_find(what, S_LEN("nr"))) != NULL) {
// Use the specified quickfix/location list
if (di->di_tv.v_type == VAR_NUMBER) {
- qf_idx = (int)di->di_tv.vval.v_number - 1;
- if (qf_idx < 0 || qf_idx >= qi->qf_listcount) {
- return FAIL;
+ // for zero use the current list
+ if (di->di_tv.vval.v_number != 0) {
+ qf_idx = (int)di->di_tv.vval.v_number - 1;
+ if (qf_idx < 0 || qf_idx >= qi->qf_listcount) {
+ return FAIL;
+ }
}
flags |= QF_GETLIST_NR;
} else {