File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ local log = require("luasnip.util.log").new("main")
20
20
21
21
local function no_region_check_wrap (fn , ...)
22
22
session .jump_active = true
23
- -- will run on next tick, after autocommands (especially CursorMoved) for this are done.
24
- vim .schedule (function ()
23
+ local fn_res = fn (... )
24
+ -- once all movements and text-modifications (and autocommands triggered by
25
+ -- these) are done, we can set jump_active false, and allow the various
26
+ -- autocommands to change luasnip-state again.
27
+ feedkeys .enqueue_action (function ()
25
28
session .jump_active = false
26
29
end )
27
30
28
- local fn_res = fn (... )
29
31
return fn_res
30
32
end
31
33
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ local function enqueue_action(fn, keys_id)
58
58
end
59
59
end
60
60
61
+ function M .enqueue_action (fn )
62
+ enqueue_action (function (id )
63
+ fn ()
64
+ M .confirm (id )
65
+ end , next_id ())
66
+ end
67
+
61
68
function M .feedkeys_insert (keys )
62
69
enqueue_action (function (id )
63
70
_feedkeys_insert (id , keys )
Original file line number Diff line number Diff line change @@ -2246,9 +2246,6 @@ describe("session", function()
2246
2246
{2:-- INSERT --recording @a} |]] ,
2247
2247
})
2248
2248
feed (" cc<Esc>Gqo<Esc>@a" )
2249
- -- this is not entirely correct!!
2250
- -- The autocommand that updated the docstring ("cc") of the original
2251
- -- snippet is disabled in the replayed snippet because.
2252
2249
screen :expect ({
2253
2250
grid = [[
2254
2251
/** |
@@ -2267,7 +2264,7 @@ describe("session", function()
2267
2264
* |
2268
2265
* @return |
2269
2266
* |
2270
- * @throws |
2267
+ * @throws cc |
2271
2268
*/ |
2272
2269
private aa bb() {4:●} |
2273
2270
throws cc { |
You can’t perform that action at this time.
0 commit comments