diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-11-03 05:13:52 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-03 05:13:52 +0900 |
commit | 75ad5587477b1fc90cb0c693794ee7053c3339c7 (patch) | |
tree | 7f6833fff12f8052c444db6b2e6ab6585f27e622 /src/nvim/ex_cmds.c | |
parent | 90981f5861e4c23c6a23a0082261b074ba48ea47 (diff) | |
parent | 1c43fb1d51cd76ccca142e73d72af56f6fb0461d (diff) | |
download | rneovim-75ad5587477b1fc90cb0c693794ee7053c3339c7.tar.gz rneovim-75ad5587477b1fc90cb0c693794ee7053c3339c7.tar.bz2 rneovim-75ad5587477b1fc90cb0c693794ee7053c3339c7.zip |
Merge #11324 from janlazo/vim-8.1.2235
vim-patch:8.1.{2235,2236}
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 2e8bd79c81..04aa8f7ef6 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3524,6 +3524,11 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, // Note: If not first match on a line, column can't be known here current_match.start.lnum = sub_firstlnum; + // Match might be after the last line for "\n\zs" matching at + // the end of the last line. + if (lnum > curbuf->b_ml.ml_line_count) { + break; + } if (sub_firstline == NULL) { sub_firstline = vim_strsave(ml_get(sub_firstlnum)); } |