Coder Social home page Coder Social logo

Comments (8)

oderwat avatar oderwat commented on June 23, 2024

That is the expected and correct behavior, as there is no indentation in this line. I wonder how your "Expected behavior" image was created. If there is a regular line, it should have the lines with and without word wrap enabled. If it means that you expect that lines are drawn in the "middle" of the line, then that expectation is wrong. The plugin cares only about the start of the line. It was mostly made for Python, Nim, Haskell or Yaml. Which means, languages where the indentation of the start of the line matters.

from vscode-indent-rainbow.

mybearworld avatar mybearworld commented on June 23, 2024

VSCode will keep the indentation the same for word wrapped lines.
image

if True:
    while True:
        print("This is a very long string that will get separated up by word wrap.")

While yes, this would theoretically mean in the middle of the line, visually it's the same line, and still the same indentation level. So it'd make sense to also mark it.

I wonder how your "Expected behavior" image was created.

Image editing.

from vscode-indent-rainbow.

oderwat avatar oderwat commented on June 23, 2024

The indentation of the line can be by definition only at the start of the line. Your line continuation does not count as an indentation for this plugin.

Image editing.

Yeah, I figured that. My question was more related to the authority that decided about the "expected behavior". It is what you expect, and your expectation is wrong for what this plugin does. I believe I got a similar request before. But most of the 5.5 million installations seem to share my expectation (or don't care).

from vscode-indent-rainbow.

GBR6000 avatar GBR6000 commented on June 23, 2024

@oderwat I personally would prefer the behaviour describe here. In #57 it makes sense to not colorize but this is different. I use the lines as an indicator of what range of code is going to get folded and so the colouring being non-continuous doesn't make sense to me. Also I think it looks worse. So an optional toggle might be nice. Obviously if it is needlessly complex to add due to the text wrapping not actually containing characters don't bother.

EDIT: To clarify in this mode the expected behaviour being the recoloration of the lines already present in VSCode by default is not strange. Notably these lines do continue during a text wrap.

from vscode-indent-rainbow.

mybearworld avatar mybearworld commented on June 23, 2024

It looks like the VSCode API doesn't actually support this. If they were to ever implement this, then this would be a great feature still.

from vscode-indent-rainbow.

oderwat avatar oderwat commented on June 23, 2024

I would not want it even if the VSCode API could do something like that. This indentation is not relevant for the code functionality, and it would harm not to see that it actually is not the indentation of the line itself. I think people who actually were originally targeted with this: Python, Haskell, Nim, Yaml and the ones that I have forgotten would also not like it because it would make reading code harder. This plugin was never about "beauty" even if people like it for that (I suppose). It was created, so you can indent and check your "code indentation language" with less cognitive burden.

from vscode-indent-rainbow.

oderwat avatar oderwat commented on June 23, 2024

Obviously if it is needlessly complex to add due to the text wrapping not actually containing characters don't bother.

If you make a PR I consider adding it as optional functionality. We had this before for other things I didn't need myself. I also cannot get tired of telling everybody and his dog, that, despite 5.6 million "installations" I got about 40 coffees from this.

from vscode-indent-rainbow.

mybearworld avatar mybearworld commented on June 23, 2024

I'd argue it's actually a functionality problem, as these are styled the exact same way as when indentation stops.

from vscode-indent-rainbow.

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.