Skip to content

Commit 4c370d5

Browse files
committed
Jump between block comment markers with matchup.
1 parent 1c04496 commit 4c370d5

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

ftplugin/lean/lean.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ if vim.g.loaded_matchit and not vim.b.match_words then
2727
[[\<\%(namespace\|section\)\s\+\([^«»]\{-}\>\|«.\{-}»\):\<end\s\+\1]],
2828
[[^\s*section\s*$:^end\s*$]],
2929
[[\<if\>:\<then\>:\<else\>]],
30+
[[\/\-[-\s]\?:-\/]],
3031
})
3132
:join ','
3233
end

spec/matchit_spec.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,28 @@ describe('matchit', function()
105105
end
106106
)
107107
)
108+
109+
it(
110+
'jumps between block comment markers',
111+
helpers.clean_buffer(
112+
[[
113+
/- A simple
114+
block comment -/
115+
116+
/-- One with
117+
two dashes -/
118+
]],
119+
function()
120+
vim.cmd.normal 'gg'
121+
assert.current_line.is '/- A simple'
122+
vim.cmd.normal '%'
123+
assert.current_line.is ' block comment -/'
124+
125+
vim.cmd.normal 'gg3j0'
126+
assert.current_line.is '/-- One with'
127+
vim.cmd.normal '%'
128+
assert.current_line.is ' two dashes -/'
129+
end
130+
)
131+
)
108132
end)

0 commit comments

Comments
 (0)