Steps to Reproduce:
"editor.wordWrap": trueThe cursor does not go to the EOL character.
We have defined a bunch of target positions for cursorMove command as below
export const CursorMovePosition = {
Left: 'left',
Right: 'right',
Up: 'up',
Down: 'down',
WrappedLineStart: 'wrappedLineStart',
WrappedLineFirstNonWhitespaceCharacter: 'wrappedLineFirstNonWhitespaceCharacter',
WrappedLineColumnCenter: 'wrappedLineColumnCenter',
WrappedLineEnd: 'wrappedLineEnd',
WrappedLineLastNonWhitespaceCharacter: 'wrappedLineLastNonWhitespaceCharacter',
ViewPortTop: 'viewPortTop',
ViewPortCenter: 'viewPortCenter',
ViewPortBottom: 'viewPortBottom',
ViewPortIfOutside: 'viewPortIfOutside'
};
Apparently we should add lineEnd and lineStart as well. A good contribution candidate for beginners.
It seems like #15121 reported a similar issue.
So, what is the expected behavior of 'Home' and 'End' with word-wrap?
@flowmemo
At least:
Better (as Sublime Text does):
@clemtoy
It seems like different editors have their own way to deal with this situation.
I just tested this behavior in Visual Studio 2015 Community, and the result is same as in VSCode.
What is the opinion from VSCode team?
I am currently looking at this issue and trying to change the behavior of the end button.
However, I think it is important to understand the opinion from the VSCode team as @flowmemo has mentioned. Is the opinion from the VSCode team equal with what @clemtoy suggests?
@rebornix What is your opinion?
@clemtoy @misoguy thanks for your continuous input on this. I can see reasons that why going to the start/end of both line and screen line is necessary. So instead of raising other users' concern, I prefer the second proposal: double press Home/End.
Understood. I'll try to change the home/end button behaviors to clemtoy's second proposal which is stated as below.
@rebornix @clemtoy I have roughly implemented the changes to home/end button behaviors. I'm open to any kind of feedbacks!
@rebornix It's been a while since this code has been implemented and added to the PR #21338. It'd be nice to get some kind of feedback when you get the chance :) Thanks!
@misoguy I left comments there but seems you didn't see it :) https://github.com/Microsoft/vscode/pull/21338/files#r103243328
BTW, did you have a test on https://github.com/Microsoft/vscode/pull/22005#discussion_r105822604 as well?
@rebornix That's wierd...because I can't find any comment at https://github.com/Microsoft/vscode/pull/21338/files#r103243328
Could you check it one more time and make sure that your review has been submitted?
Regarding the test, do you mean the test code for editorStacksModel? If so, it is implemented as commit https://github.com/Microsoft/vscode/pull/22005/commits/039a54dd1e0dc3295a3e576d5bfc041fe156733e

It's about invokeAll, we need to support multiple cursors :)

See above screenshot :)
@rebornix Thanks for the comments! I'll see what I can do about them.
For the comment on navigating between view parts, that was a minor bug in the code and I had them fixed before being merged :) It should be consistent now.
BTW, I think it's best that you submit the reviews by clicking the Finish your review button seen on the screenshot :) So that I can see them on github and reply to the comments directly.
Sorry for making you wait for so long @misoguy now I finally know the difference between A Single Comment and Start a Review :(
@rebornix No problem~ I was working on another issue and didn't really have the time to take a second look at it anyways :) I'll try get on the comments for #21338 this week~
@clemtoy @rebornix @flowmemo After implementing the changes to the behavior of Home and End button commands, it seems to me that there are some type of different situations that should be clarified.
Home at the first non whitespace column of a line which has indentation, it goes to the beginning of a line(column 0).Home commandEnd command also has the same issue just vice versa.
I'm not sure if this explanation is enough to understand...Please comment for further explanation :)
Sublime Text on my macOS works as follows with wrapped lines:
I would like to be able to set up my keybindings so that I can use it the same way.
Note: ctrl+E/A are basically system wide on macOS, except for some programs (such as VSCode)
Thank you very much !
Most helpful comment
@clemtoy @misoguy thanks for your continuous input on this. I can see reasons that why going to the start/end of both line and screen line is necessary. So instead of raising other users' concern, I prefer the second proposal: double press Home/End.