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

Lines break up when word wrap is used #158

Closed
mybearworld opened this issue Jul 16, 2023 · 8 comments
Closed

Lines break up when word wrap is used #158

mybearworld opened this issue Jul 16, 2023 · 8 comments

Comments

@mybearworld
Copy link

Enable word wrap.

Expected behavior

the lines being joined

Actual behavior

the lines being broken up

@oderwat
Copy link
Owner

oderwat commented Jul 16, 2023

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.

@oderwat oderwat closed this as completed Jul 16, 2023
@mybearworld
Copy link
Author

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.

@oderwat
Copy link
Owner

oderwat commented Jul 16, 2023

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).

@GBR6000
Copy link

GBR6000 commented Aug 2, 2023

@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.

@mybearworld
Copy link
Author

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.

@oderwat
Copy link
Owner

oderwat commented Aug 2, 2023

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.

@oderwat
Copy link
Owner

oderwat commented Aug 2, 2023

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.

@mybearworld
Copy link
Author

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

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

No branches or pull requests

3 participants