[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Inline text adornments break word wrapping #32856

Open
SharakPL opened this issue Aug 20, 2017 · 40 comments
Open

Inline text adornments break word wrapping #32856

SharakPL opened this issue Aug 20, 2017 · 40 comments
Labels
editor-wrapping Editor line wrapping issues feature-request Request for new features or functionality
Milestone

Comments

@SharakPL
Copy link
Contributor
SharakPL commented Aug 20, 2017
  • VSCode Version: 1.15.1
  • OS Version: Windows 10 x64

Steps to Reproduce:

  1. Settings:
    "editor.wordWrap": "on",
    "css.colorDecorators.enable": true
  1. Code example:
   .form-control:focus { border-color: #141d36; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 4px rgba(165,128,57,0.6); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 4px rgba(165,128,57,0.6); }

With colorDecorators disabled word wrapping works fine. After enabling it wordWrap completely ignores the width of added decorators and wrapes the code as they are not there what makes parts of the code to be pushed out of viewport.

I think it would be better to just underline the colors accordingly instead adding new elements next to it.
Also it would be great to add some margin between wrapped code and minimap (or whatever is on the right).

Reproduces without extensions: Yes

Edit: Added a screenshot to demonstrate the issue:
screen shot 2018-05-15 at 1 09 33 am

@vscodebot vscodebot bot added editor editor-core Editor basic functionality labels Aug 20, 2017
@alexdima alexdima self-assigned this Oct 26, 2017
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Nov 20, 2017
@alexdima alexdima added editor-wrapping Editor line wrapping issues feature-request Request for new features or functionality and removed editor editor-core Editor basic functionality bug Issue identified by VS Code Team member as probable bug labels Apr 18, 2018
@alexdima alexdima added this to the Backlog milestone Apr 18, 2018
@alexdima alexdima removed their assignment Apr 18, 2018
@rebornix rebornix removed their assignment Sep 5, 2018
@alexdima alexdima changed the title css.colorDecorators breaks word wrapping Inline text adornments break word wrapping Nov 19, 2019
@alexdima
Copy link
Member

The exact same issue exists for inline breakpoints. Taken from #84911 (comment)


Attaching a gif for reference:
vscode-word-wrap

@alexdima
Copy link
Member

Another screenshot from #76458

image

@usernamehw
Copy link
Contributor
usernamehw commented Jan 13, 2020

@alexdima, at this point I don't understand what this issue is...

Is it about supporting word-wrapped inline text decorations or just not showing scrollbars for them?

@alexdima
Copy link
Member

@usernamehw

Wrapping points (the locations inside a line where to break it into multiple lines) are computed using only the text of the line.

So for the following line, wrapping points are computed by looking at the following text:
image

When configuring the editor to wrap at column 34 for example, the editor computes that a good line break location is after f3. This looks reasonable and no line is going above 34 columns:
image


But when changing the language mode to CSS, which adds inline decorations (the color boxes), the wrapping points are computed in exactly the same way as before (without knowledge about the color boxes), so the wrapping point will again be after f3. But note how the text overflows column 34 because the color boxes are added after the fact:
image

@dyaso
Copy link
dyaso commented Sep 28, 2021

I'd honestly prefer it if the text decorations could appear above the arguments they're referring to, in an even smaller font. Might changing the display like that be easier than fixing this bug?

@SharakPL
Copy link
Contributor Author

@dyaso it's not that simple. There's much more different types of code decorators than colors that break word wrapping. Debugger information, variables type helpers, etc. - it's impossible to put them around the code because it would interfere with another code out there. Or it would have to be really small, almost unreadable. The best solution would be to activate wrapping after all decorators have been loaded, but with many of them being loaded by custom modules I assume it must be very hard to come up with a universal fix.

@dyaso
Copy link
dyaso commented Sep 29, 2021

@SharakPL Sorry for bothering you, i was referring to the textual type inferences and argument names rust-analyzer provides, which as well as breaking word wrap make it harder to read what i've written -- i'd prefer them to be almost unreadably small tbh, since i only want + need to read them when scrutinizing something very closely. I'll try disabling text inlay hints and relying on mouseovers for now.

@swfsql
Copy link
swfsql commented Nov 2, 2021

Also user of rust-analyzer, and my workaround is to set the Word Wrap Column really low, around 30+% lower than needed.
If this fix is unfeasible, I could live with a minimum Word Wrap Column and a maximum one, where the minimum would be used at first, and then later, after inline textual insertions, if it wouldn't pass the maximum one, perhaps the "line breaks" could be removed? Would that be more feasible to implement?

@wortwart
Copy link

Pretty disappointing that this basic bug is still not fixed. I use VS Code also as text editor but maybe I need to look for alternatives. For now, my workaround is:

  • disable the minimap in the language specific settings for Markdown or plain text (editor.minimap.enabled)
  • disable gitLens.toggleLineBlame which unfortunately is possible only on workspace-level

@eamodio
Copy link
Contributor
eamodio commented Jan 14, 2022

You can disable the GitLens blame at any level (user/workspace/folder). Check out the interactive setting ui (GitLens: Open Settings from the command palette)

@wortwart
Copy link

You're right - what I wanted to say (but didn't) was: You can't change GitLens settings in the language specific settings.

@eamodio
Copy link
Contributor
eamodio commented Jan 14, 2022

Mind opening an issue for that on the GitLens repo. Could be quite valuable outside of this issue as well.

@the-raspberry-pi-guy
Copy link

I use VS Code for writing TeX and I have come across this text-wrapping bug. Thanks for the tips about disabling Gitlens blame - that has sorted things for me at least temporarily. Annoying that one has to do this however as I quite like that integration.

@Bandit
Copy link
Bandit commented Feb 1, 2023

This issue has been open for ~6 years...

@AshleyJackson
Copy link

It seems like more comments and complaints are the only way to get things resolved, more visibility and interactions the better I guess.

I really don't understand how any company can have issues of this age without prioritising them...

@Bandit
Copy link
Bandit commented Feb 16, 2023

Indeed. It's clearly a bug, not a "feature request" 🙄

Guess it must be hard to fix so it's being back-burnered indefinitely

@starball5
Copy link

Related(?) Stack Overflow question with the LaTeX-Workshop extension: How can I adjust the position and appearance of chktex linting in VS Code?

@btshepard
Copy link

I'm also having this issue, does anyone know a workaround?

@SharakPL
Copy link
Contributor Author
SharakPL commented Apr 1, 2023

@peywan if it's such a minor fix then fix it 😉

@mybearworld
Copy link

This is quite annoying when using Tailwind, where lines get quite long, but word wrap's useless because the color decorators offset it...

@ryanwwest
Copy link

I've run into this issue as well. Maybe Gitlens has created a workaround aside from just disabling line blame...

@c0h1b4
Copy link
c0h1b4 commented Dec 6, 2023

This has been a known and documented issue for more than 5 years. When we will see a solution?

@oguh43
Copy link
oguh43 commented Dec 6, 2023

This has been a known and documented issue for more than 5 years. When we will see a solution?

Never! Let's make this the longest standing issue :)

@mybearworld
Copy link

This has been a known and documented issue for more than 5 years. When we will see a solution?

Never! Let's make this the longest standing issue :)

Let's not. This issue is really annoying and makes working in a codebase actively harder for no real reason.

@paulalbertdev
Copy link

I had to disable every extensions that post-adds text for this reason ! This bug is still very annoying, yes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-wrapping Editor line wrapping issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests