You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Option to wrap at specified column only when window is larger than the specified number of columns #1490
I am looking to be able to wrap code to 80 columns but only when my window is larger than 80 columns.
Otherwise I want it to use the viewport wrapping.
I guess this would be useful for people who have two windows open side by side and one of the windows has two files open side by side (settings.json for me). In such cases, I cannot view the file without scrolling sideways.
How can I find out the current viewport width? I think adding an extra conditional to src/vs/editor/common/config/commonEditorConfig.ts near line 117 would do the trick?
I'm sorry, this is turning out to be a bit more difficult than I expected. The codebase is really large.
You can see the patch here. I have some notes in the commit message regarding the next steps to take to integrate it properly.
This is just a proof of concept, I am looking to add a new config setting which would be a boolean deciding if this behaviour would occur. And the value for the wrappingColumn (which I fixed to 80 right now) would then be read from the wrappingColumn property.
What do you think about this approach and if there could any improvements be made, please suggest.
Activity
bpasero commentedon Dec 23, 2015
alexandrudima fyi
Fania commentedon May 8, 2016
Yes please!
hashhar commentedon May 8, 2016
I would like to start implementing this myself. Reading through the code myself and setting up the environment. Will ask if any help needed.
hashhar commentedon May 21, 2016
Hmmm, I was having some issues building it. But it's building fine now. I'll try and send a PR within a 5 or 6 days.
hashhar commentedon May 27, 2016
How can I find out the current viewport width? I think adding an extra conditional to
src/vs/editor/common/config/commonEditorConfig.tsnear line 117 would do the trick?I'm sorry, this is turning out to be a bit more difficult than I expected. The codebase is really large.
hashhar commentedon May 27, 2016
Got it working. I now need to integrate it properly. alexandrudima or Benjamin Pasero (@bpasero).
You can see the patch here. I have some notes in the commit message regarding the next steps to take to integrate it properly.
This is just a proof of concept, I am looking to add a new config setting which would be a boolean deciding if this behaviour would occur. And the value for the
wrappingColumn(which I fixed to 80 right now) would then be read from thewrappingColumnproperty.What do you think about this approach and if there could any improvements be made, please suggest.
hashhar commentedon May 30, 2016
alexandrudima I am not able to get it to show in the default config file. How is the default config file generated?
Nevermind, found it. Now all that's left is the smoke test to see if I broke anything.
hashhar commentedon May 30, 2016
I'm gonna send a PR. It works on my end.
Fania commentedon Jun 6, 2016
Sounds great. Thanks for the effort!
alexdima commentedon Aug 29, 2016
Just merged the PR from Ashhar Hasan (@hashhar). Thank you Ashhar Hasan (@hashhar)!
hashhar commentedon Aug 29, 2016
Thanks.