Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of inline comments #34

Open
savchenko opened this issue Jan 14, 2024 · 3 comments
Open

Incorrect handling of inline comments #34

savchenko opened this issue Jan 14, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@savchenko
Copy link

Steps to reproduce

  1. Create a Lua file:
    { -- Something begins here...
  1. Execute <Cmd>CBllline<CR> while on the line.

Desired result

    { -- Something begins here... ──────────────────────────────────────────────

Actual result

-- ── { -- Something begins here... ──────────────────────────────────────────────
@LudoPinelli
Copy link
Owner

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!

@LudoPinelli LudoPinelli self-assigned this Jan 14, 2024
@LudoPinelli LudoPinelli added the enhancement New feature or request label Jan 14, 2024
@savchenko
Copy link
Author

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

@LudoPinelli
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants