File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 308
308
function M .send_block (cb , flash )
309
309
flash = flash == nil and true or flash
310
310
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
312
312
M .send_line (cb , flash )
313
313
return
314
314
end
Original file line number Diff line number Diff line change 1
1
local editor = require ' scnvim.editor'
2
2
3
+ -- NOTE: only append to this data in order to not break existing tests
3
4
local content = [[
4
5
x = 123;
5
6
(
17
18
var y = 3;
18
19
y * 2;
19
20
)foo
21
+ (degree: 0).play;
20
22
]]
21
23
22
24
local buf = vim .api .nvim_create_buf (false , true )
@@ -106,6 +108,16 @@ y * 2;
106
108
return data
107
109
end )
108
110
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 )
109
121
end )
110
122
111
123
describe (' autocmds' , function ()
You can’t perform that action at this time.
0 commit comments