diff options
author | VVKot <volodymyr.kot.ua@gmail.com> | 2021-12-19 20:06:12 +0000 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-09 09:22:26 +0800 |
commit | ee903e86fdd3c9294653d9068cb499b972b2ded0 (patch) | |
tree | 82ba2ba2bd6eaedc75e59235a64cc303a7ebd222 /src/nvim/regexp.c | |
parent | 205b3765f2c04e3839b15a8d1ce79bd7ea8e4d3d (diff) | |
download | rneovim-ee903e86fdd3c9294653d9068cb499b972b2ded0.tar.gz rneovim-ee903e86fdd3c9294653d9068cb499b972b2ded0.tar.bz2 rneovim-ee903e86fdd3c9294653d9068cb499b972b2ded0.zip |
vim-patch:8.1.0748: using sprintf() instead of semsg()
Problem: Using sprintf() instead of semsg().
Solution: Use semsg(). Fix bug with E888. (Ozaki Kiichi, closes vim/vim#3801)
https://github.com/vim/vim/commit/1be45b2ea76ae2e39817a98a584d4d6cbb983a7b
vim-patch:8.1.0136: Lua tests don't cover new features
Problem: Lua tests don't cover new features.
Solution: Add more tests. (Dominique Pelle, closes vim/vim#3130)
https://github.com/vim/vim/commit/2f362bf7f9acc9ec87799d1e41bf0ae7712d1f7a
vim-patch:8.1.0139: Lua tests fail on some platforms
Problem: Lua tests fail on some platforms.
Solution: Accept a hex number with and without "0x". (Ken Takata,
closes vim/vim#3137)
https://github.com/vim/vim/commit/a8a60d0c6b292216e55f005cf9637789a771d34b
vim-patch:8.1.0164: luaeval('vim.buffer().name') returns an error
Problem: luaeval('vim.buffer().name') returns an error.
Solution: Return an empty string. (Dominique Pelle, closes vim/vim#3167)
https://github.com/vim/vim/commit/fe08df452af10db8a24dbeb1bd9ef09492a4bc66
vim-patch:8.1.0300: the old window title might be freed twice
Problem: The old window title might be freed twice. (Dominique Pelle)
Solution: Do not free "oldtitle" in a signal handler but set a flag to have
it freed later.
https://github.com/vim/vim/commit/d8f0cef2bdbdc15d7906f991725e09e67c97cf7e
vim-patch:8.1.0672: the Lua interface doesn't know about v:null
Problem: The Lua interface doesn't know about v:null.
Solution: Add Lua support for v:null. (Uji, closes vim/vim#3744)
https://github.com/vim/vim/commit/9067cd6cdfdc0bb869aa7f5d2a6c607ea8255239
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index cac95e1def..b7f11b2de0 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -468,6 +468,8 @@ static int toggle_Magic(int x) #define EMSG_RET_FAIL(m) return (emsg(m), rc_did_emsg = true, FAIL) #define EMSG2_RET_NULL(m, c) \ return (semsg((m), (c) ? "" : "\\"), rc_did_emsg = true, (void *)NULL) +#define EMSG3_RET_NULL(m, c, a) \ + return (semsg((const char *)(m), (c) ? "" : "\\", (a)), rc_did_emsg = true, (void *)NULL) #define EMSG2_RET_FAIL(m, c) \ return (semsg((m), (c) ? "" : "\\"), rc_did_emsg = true, FAIL) #define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_( \ @@ -1762,13 +1764,9 @@ static char_u *regpiece(int *flagp) if (re_multi_type(peekchr()) != NOT_MULTI) { // Can't have a multi follow a multi. if (peekchr() == Magic('*')) { - snprintf((char *)IObuff, IOSIZE, _("E61: Nested %s*"), - reg_magic >= MAGIC_ON ? "" : "\\"); - } else { - snprintf((char *)IObuff, IOSIZE, _("E62: Nested %s%c"), - reg_magic == MAGIC_ALL ? "" : "\\", no_Magic(peekchr())); + EMSG2_RET_NULL(_("E61: Nested %s*"), reg_magic >= MAGIC_ON); } - EMSG_RET_NULL((char *)IObuff); + EMSG3_RET_NULL(_("E62: Nested %s%c"), reg_magic == MAGIC_ALL, no_Magic(peekchr())); } return ret; @@ -1927,10 +1925,8 @@ static char_u *regatom(int *flagp) case Magic('{'): case Magic('*'): c = no_Magic(c); - snprintf((char *)IObuff, IOSIZE, _("E64: %s%c follows nothing"), - (c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL) - ? "" : "\\", c); - EMSG_RET_NULL((char *)IObuff); + EMSG3_RET_NULL(_("E64: %s%c follows nothing"), + (c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL), c); // NOTREACHED case Magic('~'): /* previous substitute pattern */ @@ -2537,7 +2533,9 @@ do_multibyte: static bool re_mult_next(char *what) { if (re_multi_type(peekchr()) == MULTI_MULT) { - EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what); + semsg(_("E888: (NFA regexp) cannot repeat %s"), what); + rc_did_emsg = true; + return false; } return true; } @@ -3149,9 +3147,7 @@ static int read_limits(long *minval, long *maxval) regparse++; // Allow either \{...} or \{...\} } if (*regparse != '}') { - snprintf((char *)IObuff, IOSIZE, _("E554: Syntax error in %s{...}"), - reg_magic == MAGIC_ALL ? "" : "\\"); - EMSG_RET_FAIL((char *)IObuff); + EMSG2_RET_FAIL(_("E554: Syntax error in %s{...}"), reg_magic == MAGIC_ALL); } /* |