mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 03:28:33 +00:00
vim-patch:8.2.3489: ml_get error after search with range
Problem: ml_get error after search with range.
Solution: Limit the line number to the buffer line count.
35a319b77f
This commit is contained in:
@@ -4027,8 +4027,9 @@ static linenr_T get_address(exarg_T *eap, char_u **ptr, cmd_addr_T addr_type, in
|
||||
|
||||
// When '/' or '?' follows another address, start from
|
||||
// there.
|
||||
if (lnum != MAXLNUM) {
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
if (lnum > 0 && lnum != MAXLNUM) {
|
||||
curwin->w_cursor.lnum
|
||||
= lnum > curbuf->b_ml.ml_line_count ? curbuf->b_ml.ml_line_count : lnum;
|
||||
}
|
||||
|
||||
// Start a forward search at the end of the line (unless
|
||||
|
Reference in New Issue
Block a user