Code Monkey home page Code Monkey logo

Comments (9)

LudoPinelli avatar LudoPinelli commented on June 19, 2024 1

Done!

from comment-box.nvim.

LudoPinelli avatar LudoPinelli commented on June 19, 2024

Yes, it's because :CBllline is for a titled line (first "l" for the alignement of the line, second "l" for the alignement of the text, then "line", so 3 "l"), it expects that there is a string to align left on the line where the space is.

For a simple full line, the command is :CBlline (just 2 "l").

I agree that it's not very intuitive. I will add a check in case there is no text to avoid this behavior, thanks!

from comment-box.nvim.

savchenko avatar savchenko commented on June 19, 2024

I agree that it's not very intuitive. I will add a check in case there is no text to avoid this behavior, thanks!

Might be worthwhile to merge those two under one function.

if line_contains_text then
    execute CommentWithSpace
else
    execute CommentSimpleLine

from comment-box.nvim.

LudoPinelli avatar LudoPinelli commented on June 19, 2024

Yes. It's not only the space btw, it's also the symbols before and after the text that are put no matter a text is on the line or not (it didn't show in your example because the symbols before and after the text are set to the same symbol as the one for the line by default).
For example :CBllline10 without text gives:

# ├┤  ├──────────────────────────────────────────────────────────────────┤

I'm currently rewriting the plugin from the ground up for the next version, in part because of this kind of poor design choices. The "simple lines" and "titled lines" won't be treated as two different categories.
But it will take some time, I will make a patch for the current version.

from comment-box.nvim.

savchenko avatar savchenko commented on June 19, 2024

I'm currently rewriting the plugin from the ground up for the next version

Do you plan to land #36 there or as a patch for the current master?

from comment-box.nvim.

LudoPinelli avatar LudoPinelli commented on June 19, 2024

It will be for the the rewritten version, it needs too many changes to be patch for the current one. It's going quite well so far, but I honestly don't know when it will be available.

from comment-box.nvim.

savchenko avatar savchenko commented on June 19, 2024

Updated to latest, executing on this line:

        config = function()

CBllline<cr>

Note the offset and spaces.

-- -- config = function() --------------------------------------------------------

:CBlline<cr>

-- -------------------------------------------------------------------------------

from comment-box.nvim.

LudoPinelli avatar LudoPinelli commented on June 19, 2024

Sorry, I don't understand what the problem is in your example?

from comment-box.nvim.

savchenko avatar savchenko commented on June 19, 2024

I would expect that from this:

        config = function()

comment-box returns either:

-- ---- config = function() ---------------------------------------------------

or

--      config = function() ---------------------------------------------------

Note the preserved column position.

from comment-box.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.