aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-05 00:46:06 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-05 09:47:38 -0500
commit25cb2c722e74ea62c289ecba8a6e98db5ee67493 (patch)
tree1985ab29cd263db3e14ace22ba3644c38f837190 /src/nvim/option.c
parent5b897acfc1e9bf3c44f7e255743e2b9c8b6d1142 (diff)
downloadrneovim-25cb2c722e74ea62c289ecba8a6e98db5ee67493.tar.gz
rneovim-25cb2c722e74ea62c289ecba8a6e98db5ee67493.tar.bz2
rneovim-25cb2c722e74ea62c289ecba8a6e98db5ee67493.zip
vim-patch:8.2.0590: no 'backspace' value allows ignoring the insertion point
Problem: No 'backspace' value allows ignoring the insertion point. Solution: Add the "nostop" and 3 values. (Christian Brabandt, closes vim/vim#5940) https://github.com/vim/vim/commit/aa0489e12d227d24752cf16e4e97058ac32edcc1
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index d43dd9ba15..47b9e9bb07 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -306,7 +306,7 @@ static char *(p_buftype_values[]) = { "nofile", "nowrite", "quickfix",
static char *(p_bufhidden_values[]) = { "hide", "unload", "delete",
"wipe", NULL };
-static char *(p_bs_values[]) = { "indent", "eol", "start", NULL };
+static char *(p_bs_values[]) = { "indent", "eol", "start", "nostop", NULL };
static char *(p_fdm_values[]) = { "manual", "expr", "marker", "indent",
"syntax", "diff", NULL };
static char *(p_fcl_values[]) = { "all", NULL };
@@ -1366,6 +1366,10 @@ int do_set(
*(char_u **)varp = vim_strsave(
(char_u *)"indent,eol,start");
break;
+ case 3:
+ *(char_u **)varp = vim_strsave(
+ (char_u *)"indent,eol,nostop");
+ break;
}
xfree(oldval);
if (origval == oldval) {
@@ -2939,7 +2943,7 @@ ambw_end:
}
} else if (varp == &p_bs) { // 'backspace'
if (ascii_isdigit(*p_bs)) {
- if (*p_bs >'2' || p_bs[1] != NUL) {
+ if (*p_bs > '3' || p_bs[1] != NUL) {
errmsg = e_invarg;
}
} else if (check_opt_strings(p_bs, p_bs_values, true) != OK) {
@@ -6801,15 +6805,15 @@ static int check_opt_wim(void)
}
/// Check if backspacing over something is allowed.
-/// The parameter what is one of the following: whatBS_INDENT, BS_EOL
-/// or BS_START
+/// @param what BS_INDENT, BS_EOL, BS_START, or BS_NOSTOP
bool can_bs(int what)
{
if (what == BS_START && bt_prompt(curbuf)) {
return false;
}
switch (*p_bs) {
- case '2': return true;
+ case '3': return true;
+ case '2': return what != BS_NOSTOP;
case '1': return what != BS_START;
case '0': return false;
}