@@ -280,13 +280,30 @@ describe("can do variable debug statement insertion", function()
280
280
281
281
after_each (teardown )
282
282
283
+ it (" can insert a variable statement below using the default value" , function ()
284
+ local filename = init_file ({
285
+ " foo" ,
286
+ " bar" ,
287
+ }, " lua" , 1 , 0 )
288
+
289
+ feedkeys (" g?v<CR>" )
290
+
291
+ check_lines ({
292
+ " foo" ,
293
+ " print('DEBUGPRINT[1]: "
294
+ .. filename
295
+ .. " :1: foo=' .. vim.inspect(foo))" ,
296
+ " bar" ,
297
+ })
298
+ end )
299
+
283
300
it (" can insert a variable statement below" , function ()
284
301
local filename = init_file ({
285
302
" foo" ,
286
303
" bar" ,
287
304
}, " lua" , 1 , 0 )
288
305
289
- feedkeys (" g?vbanana <CR>" )
306
+ feedkeys (" g?v<BS><BS><BS>banana <CR>" )
290
307
291
308
check_lines ({
292
309
" foo" ,
@@ -303,7 +320,7 @@ describe("can do variable debug statement insertion", function()
303
320
" bar" ,
304
321
}, " lua" , 1 , 0 )
305
322
306
- feedkeys (" g?Vbanana <CR>" )
323
+ feedkeys (" g?V<BS><BS><BS>banana <CR>" )
307
324
308
325
check_lines ({
309
326
" print('DEBUGPRINT[1]: "
@@ -320,7 +337,7 @@ describe("can do variable debug statement insertion", function()
320
337
" bar" ,
321
338
}, " lua" , 1 , 0 )
322
339
323
- feedkeys (" g?v<CR>" )
340
+ feedkeys (" g?v<BS><BS><BS>< CR>" )
324
341
assert .are .same (" No variable name entered." , notify_message )
325
342
326
343
check_lines ({
@@ -358,7 +375,7 @@ describe("can do various file types", function()
358
375
" bar" ,
359
376
}, " vim" , 1 , 0 )
360
377
361
- feedkeys (" g?vbanana <CR>" )
378
+ feedkeys (" g?v<BS><BS><BS>banana <CR>" )
362
379
363
380
check_lines ({
364
381
" foo" ,
@@ -521,7 +538,7 @@ describe("add custom filetype with setup()", function()
521
538
" bar" ,
522
539
}, " wibble" , 1 , 0 )
523
540
524
- feedkeys (" g?vapple <CR>" )
541
+ feedkeys (" g?v<BS><BS><BS>apple <CR>" )
525
542
526
543
check_lines ({
527
544
" foo" ,
@@ -714,9 +731,9 @@ describe("can repeat", function()
714
731
" bar" ,
715
732
}, " lua" , 1 , 0 )
716
733
717
- feedkeys (" g?vbanana <CR>" )
734
+ feedkeys (" g?v<BS><BS><BS>banana <CR>" )
718
735
feedkeys (" ." )
719
- feedkeys (" g?Vapple <CR>" )
736
+ feedkeys (" g?V<BS><BS><BS>apple <CR>" )
720
737
feedkeys (" ." )
721
738
722
739
check_lines ({
@@ -822,7 +839,7 @@ describe("can handle treesitter identifiers", function()
822
839
" end" ,
823
840
}, " lua" , 2 , 9 )
824
841
825
- feedkeys (" g?vapple <CR>" )
842
+ feedkeys (" g?v<BS><BS><BS>apple <CR>" )
826
843
827
844
check_lines ({
828
845
" function x()" ,
@@ -853,7 +870,7 @@ describe("can handle treesitter identifiers", function()
853
870
end , {
854
871
expr = true ,
855
872
})
856
- feedkeys (" zxaapple <CR>" )
873
+ feedkeys (" zxa<BS><BS><BS>apple <CR>" )
857
874
858
875
check_lines ({
859
876
" function x()" ,
@@ -1295,7 +1312,7 @@ describe("don't display counter", function()
1295
1312
" bar" ,
1296
1313
}, " lua" , 1 , 0 )
1297
1314
1298
- feedkeys (" g?vbanana <CR>" )
1315
+ feedkeys (" g?v<BS><BS><BS>banana <CR>" )
1299
1316
1300
1317
check_lines ({
1301
1318
" foo" ,
0 commit comments