+19
-2
lines changedFilter options
+19
-2
lines changed Original file line number Diff line number Diff line change
@@ -2074,7 +2074,7 @@ void vungetc(int c)
2074
2074
2075
2075
/// When peeking and not getting a character, reg_executing cannot be cleared
2076
2076
/// yet, so set a flag to clear it later.
2077
-
static void check_end_reg_executing(bool advance)
2077
+
void check_end_reg_executing(bool advance)
2078
2078
{
2079
2079
if (reg_executing != 0 && (typebuf.tb_maplen == 0 || pending_end_reg_executing)) {
2080
2080
if (advance) {
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ void state_enter(VimState *s)
40
40
int key;
41
41
42
42
getkey:
43
-
// Expand mappings first by calling vpeekc() directly.
43
+
// Apply mappings first by calling vpeekc() directly.
44
44
// - If vpeekc() returns non-NUL, there is a character already available for processing, so
45
45
// don't block for events. vgetc() may still block, in case of an incomplete UTF-8 sequence.
46
46
// - If vpeekc() returns NUL, vgetc() will block, and there are three cases:
@@ -76,6 +76,9 @@ void state_enter(VimState *s)
76
76
}
77
77
78
78
if (key == K_EVENT) {
79
+
// An event handler may use the value of reg_executing.
80
+
// Clear it if it should be cleared when getting the next character.
81
+
check_end_reg_executing(true);
79
82
may_sync_undo();
80
83
}
81
84
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ local feed = helpers.feed
6
6
local clear = helpers.clear
7
7
local expect = helpers.expect
8
8
local command = helpers.command
9
+
local funcs = helpers.funcs
9
10
local meths = helpers.meths
10
11
local insert = helpers.insert
11
12
local curbufmeths = helpers.curbufmeths
@@ -54,6 +55,19 @@ describe('immediately after a macro has finished executing,', function()
54
55
command([[let @a = 'gg0']])
55
56
end)
56
57
58
+
describe('reg_executing() from RPC returns an empty string', function()
59
+
it('if the macro does not end with a <Nop> mapping', function()
60
+
feed('@a')
61
+
eq('', funcs.reg_executing())
62
+
end)
63
+
64
+
it('if the macro ends with a <Nop> mapping', function()
65
+
command('nnoremap 0 <Nop>')
66
+
feed('@a')
67
+
eq('', funcs.reg_executing())
68
+
end)
69
+
end)
70
+
57
71
describe('characters from a mapping are not treated as a part of the macro #18015', function()
58
72
before_each(function()
59
73
command('nnoremap s qa')
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