File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 308308function M .send_block (cb , flash )
309309 flash = flash == nil and true or flash
310310 local lstart , lend = unpack (vim .fn [' scnvim#editor#get_block' ]())
311- if lstart == 0 or lend == 0 then
311+ if lstart == lend or lstart == 0 or lend == 0 then
312312 M .send_line (cb , flash )
313313 return
314314 end
Original file line number Diff line number Diff line change 11local editor = require ' scnvim.editor'
22
3+ -- NOTE: only append to this data in order to not break existing tests
34local content = [[
45x = 123;
56(
1718var y = 3;
1819y * 2;
1920)foo
21+ (degree: 0).play;
2022]]
2123
2224local buf = vim .api .nvim_create_buf (false , true )
@@ -106,6 +108,16 @@ y * 2;
106108 return data
107109 end )
108110 end )
111+
112+ it (' can send a single line containing parenthesis' , function ()
113+ vim .api .nvim_win_set_cursor (0 , { 17 , 0 })
114+ editor .send_block (function (data )
115+ local block = table.concat (data , ' \n ' )
116+ local expected = [[ (degree: 0).play;]]
117+ assert .are .equal (expected , block )
118+ return data
119+ end )
120+ end )
109121 end )
110122
111123 describe (' autocmds' , function ()
You can’t perform that action at this time.
0 commit comments