+31
-7
lines changedFilter options
+31
-7
lines changed Original file line number Diff line number Diff line change
@@ -1583,6 +1583,14 @@ int vgetc(void)
1583
1583
c = utf_ptr2char(buf);
1584
1584
}
1585
1585
1586
+
if ((mod_mask & MOD_MASK_CTRL) && (c >= '?' && c <= '_')) {
1587
+
c = Ctrl_chr(c);
1588
+
mod_mask &= ~MOD_MASK_CTRL;
1589
+
if (c == 0) { // <C-@> is <Nul>
1590
+
c = K_ZERO;
1591
+
}
1592
+
}
1593
+
1586
1594
// If mappings are enabled (i.e., not Ctrl-v) and the user directly typed
1587
1595
// something with a meta- or alt- modifier that was not mapped, interpret
1588
1596
// <M-x> as <Esc>x rather than as an unbound meta keypress. #8213
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
13
13
#include "nvim/memory.h"
14
14
#include "nvim/message.h"
15
15
#include "nvim/mouse.h"
16
+
#include "nvim/option_defs.h"
16
17
#include "nvim/strings.h"
17
18
#include "nvim/vim.h"
18
19
@@ -744,12 +745,15 @@ static int extract_modifiers(int key, int *modp)
744
745
modifiers &= ~MOD_MASK_SHIFT;
745
746
}
746
747
}
747
-
if ((modifiers & MOD_MASK_CTRL)
748
-
&& ((key >= '?' && key <= '_') || ASCII_ISALPHA(key))) {
749
-
key = Ctrl_chr(key);
750
-
modifiers &= ~MOD_MASK_CTRL;
751
-
if (key == 0) { // <C-@> is <Nul>
752
-
key = K_ZERO;
748
+
if ((modifiers & MOD_MASK_CTRL) && ((key >= '?' && key <= '_') || ASCII_ISALPHA(key))) {
749
+
key = TOUPPER_ASC(key);
750
+
int new_key = Ctrl_chr(key);
751
+
if (!p_clbg || (new_key != TAB && new_key != CAR && new_key != ESC)) {
752
+
key = new_key;
753
+
modifiers &= ~MOD_MASK_CTRL;
754
+
if (key == 0) { // <C-@> is <Nul>
755
+
key = K_ZERO;
756
+
}
753
757
}
754
758
}
755
759
Original file line number Diff line number Diff line change
@@ -401,6 +401,7 @@ EXTERN int p_cst; // 'cscopetag'
401
401
EXTERN long p_csto; // 'cscopetagorder'
402
402
EXTERN long p_cspc; // 'cscopepathcomp'
403
403
EXTERN int p_csverbose; // 'cscopeverbose'
404
+
EXTERN int p_clbg; // 'ctrldisambig'
404
405
EXTERN char_u *p_debug; // 'debug'
405
406
EXTERN char_u *p_def; // 'define'
406
407
EXTERN char_u *p_inc;
Original file line number Diff line number Diff line change
@@ -541,6 +541,13 @@ return {
541
541
varname='p_csverbose',
542
542
defaults={if_true=1}
543
543
},
544
+
{
545
+
full_name='ctrldisambig', abbreviation='clbg',
546
+
short_desc=N_(""),
547
+
type='bool', scope={'global'},
548
+
varname='p_clbg',
549
+
defaults={if_true=true}
550
+
},
544
551
{
545
552
full_name='cursorbind', abbreviation='crb',
546
553
short_desc=N_("move cursor in window as it moves in other windows"),
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ set fsync
14
14
set laststatus=1
15
15
set listchars=eol:$
16
16
set joinspaces
17
+
set noctrldisambig
17
18
set nohidden nosmarttab noautoindent noautoread complete-=i noruler noshowcmd
18
19
set nrformats+=octal
19
20
set shortmess-=F
Original file line number Diff line number Diff line change
@@ -35,7 +35,10 @@ describe('eval', function()
35
35
endfun
36
36
]])
37
37
end)
38
-
before_each(clear)
38
+
before_each(function()
39
+
clear()
40
+
command('set noctrldisambig')
41
+
end)
39
42
teardown(function()
40
43
os.remove('test_eval_setup.vim')
41
44
end)
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4