Incorrect handling of inline comments
Steps to reproduce
- Create a Lua file:
{ -- Something begins here...
- Execute
<Cmd>CBllline<CR>while on the line.
Desired result
{ -- Something begins here... ──────────────────────────────────────────────
Actual result
-- ── { -- Something begins here... ──────────────────────────────────────────────
Yes, the plugin doesn't support inline comments at the moment. I have to mention it in the README.
It's seems kind of tricky to do, but I guess it could be a nice thing to have. I add it to the TODO list. Sorry for the disappointment and thanks for the suggestion!
No disappointment at all. Would a naive check suffice at first? In pseudocode:
comment_pattern = regex_comment_pattern
comment_pos = line.index(comment_pattern)
if comment_pos then
apply_comment_box.from(comment_pos)
end
No disappointment at all. Would a naive check suffice at first? In pseudocode:
comment_pattern = regex_comment_pattern comment_pos = line.index(comment_pattern) if comment_pos then apply_comment_box.from(comment_pos) end
Probably, but at the moment, the code only knows the number of the line where the cursor is (or the first and last line selected in visual mode), not the position of the cursor in the line, so I need to implement that.