File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -125,18 +125,26 @@ describe("Swapping in a regular lua file:", function()
125
125
end )
126
126
end )
127
127
128
+ -- doesn't work at all in md, doesn't need to
128
129
describe (" Swapping in a markdown file:" , function ()
129
130
before_each (function ()
130
- -- TODO This is a hack, really should be able to load a md file. Fix this.
131
- load_fixture (" /lua.lua" )
131
+ load_fixture (" /markdown.md" )
132
132
vim .bo [0 ].filetype = " markdown"
133
133
end )
134
134
135
- it (" turns off in md files (doesn't work at all there, doesn't need to)" , function ()
135
+ it (" turns off for down in md files" , function ()
136
+ vim .fn .cursor (1 , 1 )
136
137
local lines_before = lines .get_lines (0 , - 1 )
137
- tw .swap_up ()
138
138
tw .swap_down ()
139
139
local lines_after = lines .get_lines (0 , - 1 )
140
140
assert .same (lines_after , lines_before )
141
141
end )
142
+
143
+ it (" turns off for up in md files" , function ()
144
+ vim .fn .cursor (3 , 1 )
145
+ local lines_before = lines .get_lines (0 , - 1 )
146
+ tw .swap_up ()
147
+ local lines_after = lines .get_lines (0 , - 1 )
148
+ assert .same (lines_after , lines_before )
149
+ end )
142
150
end )
You can’t perform that action at this time.
0 commit comments