+32
-0
lines changedFilter options
+32
-0
lines changed Original file line number Diff line number Diff line change
@@ -412,6 +412,7 @@ void terminal_enter(void)
412
412
curwin->w_redr_status = true; // For mode() in statusline. #8323
413
413
ui_busy_start();
414
414
apply_autocmds(EVENT_TERMENTER, NULL, NULL, false, curbuf);
415
+
trigger_modechanged();
415
416
416
417
s->state.execute = terminal_execute;
417
418
s->state.check = terminal_check;
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
1
+
local helpers = require('test.functional.helpers')(after_each)
2
+
local clear, eval, eq = helpers.clear, helpers.eval, helpers.eq
3
+
local feed, command = helpers.feed, helpers.command
4
+
5
+
describe('ModeChanged', function()
6
+
before_each(function()
7
+
clear()
8
+
command('let g:count = 0')
9
+
command('au ModeChanged * let g:event = copy(v:event)')
10
+
command('au ModeChanged * let g:count += 1')
11
+
end)
12
+
13
+
it('picks up terminal mode changes', function()
14
+
command("term")
15
+
feed('i')
16
+
eq({
17
+
old_mode = 'nt',
18
+
new_mode = 't'
19
+
}, eval('g:event'))
20
+
feed('<c-\\><c-n>')
21
+
eq({
22
+
old_mode = 't',
23
+
new_mode = 'nt'
24
+
}, eval('g:event'))
25
+
eq(3, eval('g:count'))
26
+
command("bd!")
27
+
28
+
-- v:event is cleared after the autocommand is done
29
+
eq({}, eval('v:event'))
30
+
end)
31
+
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