Mercurial > vim
comparison src/quickfix.c @ 10237:197795e3530d v8.0.0017
commit https://github.com/vim/vim/commit/890680ca6364386fabb271c85e0755bcaa6a33c1
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 27 21:28:56 2016 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 27 Sep 2016 21:30:04 +0200 |
parents | 7a4fb555c83a |
children | 2d0e6034743a |
comparison
equal
deleted
inserted
replaced
10236:4a297449804b | 10237:197795e3530d |
---|---|
4589 if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL) | 4589 if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL) |
4590 { | 4590 { |
4591 /* Use the specified quickfix/location list */ | 4591 /* Use the specified quickfix/location list */ |
4592 if (di->di_tv.v_type == VAR_NUMBER) | 4592 if (di->di_tv.v_type == VAR_NUMBER) |
4593 { | 4593 { |
4594 qf_idx = di->di_tv.vval.v_number - 1; | 4594 /* for zero use the current list */ |
4595 if (qf_idx < 0 || qf_idx >= qi->qf_listcount) | 4595 if (di->di_tv.vval.v_number != 0) |
4596 return FAIL; | 4596 { |
4597 qf_idx = di->di_tv.vval.v_number - 1; | |
4598 if (qf_idx < 0 || qf_idx >= qi->qf_listcount) | |
4599 return FAIL; | |
4600 } | |
4597 flags |= QF_GETLIST_NR; | 4601 flags |= QF_GETLIST_NR; |
4598 } | 4602 } |
4599 else | 4603 else |
4600 return FAIL; | 4604 return FAIL; |
4601 } | 4605 } |