+64
-1
lines changedFilter options
+64
-1
lines changed Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
15
15
#include "nvim/option.h"
16
16
#include "nvim/option_defs.h"
17
17
#include "nvim/os/input.h"
18
+
#include "nvim/screen.h"
18
19
#include "nvim/state.h"
19
20
#include "nvim/ui.h"
20
21
#include "nvim/vim.h"
@@ -54,6 +55,12 @@ void state_enter(VimState *s)
54
55
// Event was made available after the last multiqueue_process_events call
55
56
key = K_EVENT;
56
57
} else {
58
+
// Duplicate display updating logic in vgetorpeek()
59
+
if (((State & INSERT) != 0 || p_lz) && (State & CMDLINE) == 0
60
+
&& must_redraw != 0 && !need_wait_return) {
61
+
update_screen(0);
62
+
setcursor(); // put cursor back where it belongs
63
+
}
57
64
// Flush screen updates before blocking
58
65
ui_flush();
59
66
// Call `os_inchar` directly to block for events or user input without
Original file line number Diff line number Diff line change
@@ -1589,6 +1589,18 @@ describe('API', function()
1589
1589
feed(':digraphs<cr>')
1590
1590
eq({mode='rm', blocking=true}, nvim("get_mode"))
1591
1591
end)
1592
+
1593
+
it('after <Nop> mapping returns blocking=false #17257', function()
1594
+
command('nnoremap <F2> <Nop>')
1595
+
feed('<F2>')
1596
+
eq({mode='n', blocking=false}, nvim("get_mode"))
1597
+
end)
1598
+
1599
+
it('after empty string <expr> mapping returns blocking=false #17257', function()
1600
+
command('nnoremap <expr> <F2> ""')
1601
+
feed('<F2>')
1602
+
eq({mode='n', blocking=false}, nvim("get_mode"))
1603
+
end)
1592
1604
end)
1593
1605
1594
1606
describe('RPC (K_EVENT)', function()
Original file line number Diff line number Diff line change
@@ -320,3 +320,47 @@ describe("event processing and input", function()
320
320
eq({'notification', 'stop', {}}, next_msg())
321
321
end)
322
322
end)
323
+
324
+
describe('display is updated', function()
325
+
local screen
326
+
before_each(function()
327
+
screen = Screen.new(60, 8)
328
+
screen:set_default_attr_ids({
329
+
[1] = {bold = true, foreground = Screen.colors.Blue1}, -- NonText
330
+
[2] = {bold = true}, -- ModeMsg
331
+
})
332
+
screen:attach()
333
+
end)
334
+
335
+
it('in Insert mode after <Nop> mapping #17911', function()
336
+
command('imap <Plug>test <Nop>')
337
+
command('imap <F2> abc<CR><Plug>test')
338
+
feed('i<F2>')
339
+
screen:expect([[
340
+
abc |
341
+
^ |
342
+
{1:~ }|
343
+
{1:~ }|
344
+
{1:~ }|
345
+
{1:~ }|
346
+
{1:~ }|
347
+
{2:-- INSERT --} |
348
+
]])
349
+
end)
350
+
351
+
it('in Insert mode after empty string <expr> mapping #17911', function()
352
+
command('imap <expr> <Plug>test ""')
353
+
command('imap <F2> abc<CR><Plug>test')
354
+
feed('i<F2>')
355
+
screen:expect([[
356
+
abc |
357
+
^ |
358
+
{1:~ }|
359
+
{1:~ }|
360
+
{1:~ }|
361
+
{1:~ }|
362
+
{1:~ }|
363
+
{2:-- INSERT --} |
364
+
]])
365
+
end)
366
+
end)
Original file line number Diff line number Diff line change
@@ -273,7 +273,7 @@ describe('timers', function()
273
273
eq("Vim(call):E48: Not allowed in sandbox", exc_exec("sandbox call timer_start(0, 'Scary')"))
274
274
end)
275
275
276
-
it('can be triggered after an empty string <expr> mapping', function()
276
+
it('can be triggered after an empty string <expr> mapping #17257', function()
277
277
local screen = Screen.new(40, 6)
278
278
screen:attach()
279
279
command([=[imap <expr> <F2> [timer_start(0, { _ -> execute("throw 'x'", "") }), ''][-1]]=])
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