mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
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)
aa0489e12d
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user