diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-09 18:33:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-09 18:33:38 +0800 |
commit | 420b94eeece989a72b8891110f7d272f50eb0a1e (patch) | |
tree | 74ed486e5a2a825d99fed78b28661ffcde0bfae2 /src | |
parent | b7734c4ec84f0de14fcf86cfacefbed8a3ecf600 (diff) | |
parent | b9d9cd77421a7906d6e0a968a3c0ddd86e9923fe (diff) | |
download | rneovim-420b94eeece989a72b8891110f7d272f50eb0a1e.tar.gz rneovim-420b94eeece989a72b8891110f7d272f50eb0a1e.tar.bz2 rneovim-420b94eeece989a72b8891110f7d272f50eb0a1e.zip |
Merge pull request #25058 from zeertzjq/vim-9.0.1886
vim-patch:9.0.{1877,partial:1886}
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.c | 4 | ||||
-rw-r--r-- | src/nvim/keycodes.c | 3 | ||||
-rw-r--r-- | src/nvim/mbyte.c | 2 | ||||
-rw-r--r-- | src/nvim/window.c | 4 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index a0618ce7d7..4f6b8f2c8f 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3888,6 +3888,10 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const long cmdpreview_ nmatch = curbuf->b_ml.ml_line_count - sub_firstlnum + 1; current_match.end.lnum = sub_firstlnum + (linenr_T)nmatch; skip_match = true; + // safety check + if (nmatch < 0) { + goto skip; + } } // Save the line numbers for the preview buffer diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c index f2391cc541..55cd22f181 100644 --- a/src/nvim/keycodes.c +++ b/src/nvim/keycodes.c @@ -919,7 +919,8 @@ char *replace_termcodes(const char *const from, const size_t from_len, char **co // Check for special <> keycodes, like "<C-S-LeftMouse>" if (do_special && ((flags & REPTERM_DO_LT) || ((end - src) >= 3 && strncmp(src, "<lt>", 4) != 0))) { - // Replace <SID> by K_SNR <script-nr> _. + // Change <SID>Func to K_SNR <script-nr> _Func. This name is used + // for script-local user functions. // (room: 5 * 6 = 30 bytes; needed: 3 + <nr> + 1 <= 14) if (end - src >= 4 && STRNICMP(src, "<SID>", 5) == 0) { if (sid_arg < 0 || (sid_arg == 0 && current_sctx.sc_sid <= 0)) { diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index fd9efb1387..6182646fe7 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1648,7 +1648,7 @@ bool utf_allow_break_before(int cc) 0x2021, // ‡ double dagger 0x2026, // … horizontal ellipsis 0x2030, // ‰ per mille sign - 0x2031, // ‱ per then thousand sign + 0x2031, // ‱ per the thousand sign 0x203c, // ‼ double exclamation mark 0x2047, // ⁇ double question mark 0x2048, // ⁈ question exclamation mark diff --git a/src/nvim/window.c b/src/nvim/window.c index e72c32700d..9d804ecae7 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1884,6 +1884,10 @@ static void win_exchange(int Prenum) beep_flush(); return; } + if (text_or_buf_locked()) { + beep_flush(); + return; + } frame_T *frp; |