Problem: Cannot navigate through errors relative to the cursor.
Solution: Add :cabove, :cbelow, :labove and :lbelow. (Yegappan Lakshmanan,
closesvim/vim#4316)
3ff33114d7
Problem: Quickfix code is repeated.
Solution: Define FOR_ALL_QFL_ITEMS(). Move some code to separate functions.
(Yegappan Lakshmanan, closesvim/vim#4166)
a16123a666
Problem: Quickfix function arguments are inconsistent.
Solution: Pass a list pointer instead of info and index. (Yegappan
Lakshmanan, closesvim/vim#4135)
0398e00a1b
Problem: Using freed memory in quickfix code. (Dominique Pelle)
Solution: Add the quickfix_busy() flag to postpone deleting quickfix lists
until it is safe. (Yegappan Lakshmanan, closes#3538)
9f84ded38b
Problem: Quickfix code mixes using the stack and a list pointer.
Solution: Use a list pointer in more places. (Yegappan Lakshmanan,
closesvim/vim#3443)
fe15b7dfa6
Problem: :cfile does not abort like other quickfix commands.
Solution: Abort when desired. Add tests for aborting. (Yegappan Lakshmanan,
closesvim/vim#5121)
6a0cc916bd
Convenient for API clients who want to reuse the API docs in their own
docs. Could be used e.g. to eliminate nvim.net's own doxygen parser:
3a736232a4/src/NvimClient.APIGenerator/Docs
TODO: currently the result values are formatted as Vim help docs. We
should change the values to have structure, something like this:
[{
'nvim_win_get_var': [
'line1,
'line2',
[ 'item1', 'item2', ... ]
],
'nvim_win_set_var': [
...
],
...
}]
close#11296
In order to find if there was already an open man page, the :Man command
would cycle through each window to see if &ft=='man'. This triggers
autocmds, e.g. BufEnter, unnecessarily and can have unexpected
side-effects.
Change the logic to check each window's ft without switching to it
unless it is actually a man window.
Signed-off-by: Joshua Rubin <me@jawa.dev>
Problem: Cannot get the window id associated with the location list.
Solution: Add the "filewinid" argument to getloclist(). (Yegappan
Lakshmanan, closesvim/vim#3202)
c9cc9c78f2
The `HASHTAB_ITER` logic keeps track of how many entries in the hash
table are left to visit, decrementing this on each iteration of the
loop. This was previously decremented at the end of the loop body:
```c
size_t hi##todo_ = hi##ht_->ht_used;
for (hashitem_T *hi = hi##ht_->ht_array; hi##todo_; hi++) {
if (!HASHITEM_EMPTY(hi)) {
{
<user code, macro-inserted>
}
hi##todo_--; // <--- important decrement here
}
}
```
This meant that if the body of the loop (substituted in via macro
expansion) contained a `continue` statement, we'd skip decrementing our
counter, meaning we'd iterate too many times over the hash table,
usually leading to an out of bounds read beyond the hash table's
memory, or uninitialised/null pointers from unused hash table slots.
Decrementing `hi##todo` before the arbitrary loop body protects us from
this, and has no adverse side-effects since only the macro code can (or
should) use this variable.
Before this commit, no code within `HASHTAB_ITER()` contained a
`continue`, meaning this bug was left dormant and the fix has a very
minimal chance of introducing any bugs.