Mercurial > vim
comparison src/option.c @ 20069:9a67d41708d2 v8.2.0590
patch 8.2.0590: no 'backspace' value allows ignoring the insertion point
Commit: https://github.com/vim/vim/commit/aa0489e12d227d24752cf16e4e97058ac32edcc1
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 17 19:41:21 2020 +0200
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 https://github.com/vim/vim/issues/5940)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 17 Apr 2020 19:45:05 +0200 |
parents | aadd1cae2ff5 |
children | 918245588b50 |
comparison
equal
deleted
inserted
replaced
20068:b644ea832304 | 20069:9a67d41708d2 |
---|---|
1683 break; | 1683 break; |
1684 case 2: | 1684 case 2: |
1685 *(char_u **)varp = vim_strsave( | 1685 *(char_u **)varp = vim_strsave( |
1686 (char_u *)"indent,eol,start"); | 1686 (char_u *)"indent,eol,start"); |
1687 break; | 1687 break; |
1688 case 3: | |
1689 *(char_u **)varp = vim_strsave( | |
1690 (char_u *)"indent,eol,nostop"); | |
1691 break; | |
1688 } | 1692 } |
1689 vim_free(oldval); | 1693 vim_free(oldval); |
1690 if (origval == oldval) | 1694 if (origval == oldval) |
1691 origval = *(char_u **)varp; | 1695 origval = *(char_u **)varp; |
1692 if (origval_l == oldval) | 1696 if (origval_l == oldval) |
6816 /* | 6820 /* |
6817 * Check if backspacing over something is allowed. | 6821 * Check if backspacing over something is allowed. |
6818 */ | 6822 */ |
6819 int | 6823 int |
6820 can_bs( | 6824 can_bs( |
6821 int what) // BS_INDENT, BS_EOL or BS_START | 6825 int what) // BS_INDENT, BS_EOL, BS_START or BS_NOSTOP |
6822 { | 6826 { |
6823 #ifdef FEAT_JOB_CHANNEL | 6827 #ifdef FEAT_JOB_CHANNEL |
6824 if (what == BS_START && bt_prompt(curbuf)) | 6828 if (what == BS_START && bt_prompt(curbuf)) |
6825 return FALSE; | 6829 return FALSE; |
6826 #endif | 6830 #endif |
6827 switch (*p_bs) | 6831 switch (*p_bs) |
6828 { | 6832 { |
6829 case '2': return TRUE; | 6833 case '3': return TRUE; |
6834 case '2': return (what != BS_NOSTOP); | |
6830 case '1': return (what != BS_START); | 6835 case '1': return (what != BS_START); |
6831 case '0': return FALSE; | 6836 case '0': return FALSE; |
6832 } | 6837 } |
6833 return vim_strchr(p_bs, what) != NULL; | 6838 return vim_strchr(p_bs, what) != NULL; |
6834 } | 6839 } |