-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Add an option to prevent the arrow keys from moving cursor to previous/next line #11444
Comments
Look for "word wrap" in the icon bar. That is the line wrap. |
Hi, these are two different things. "Word wrap" is related to how the text is displayed and makes long lines fully visible with a smaller window by splitting them adding "virtual" unnumbered lines. "Line wrap" is related to edition itself and determines where the caret goes when moving within the text and reaching the start or the end of a line and trying to continue moving in that direction. |
Just as a general question: why don't you use the HOME/POS1 and END key? Is the use-case different from what those keys do? |
I use these keys thorougly too, of course. Sometimes it's better to use the arrows and sometimes it's better to use these. I don't see how that is relevant to this issue. |
@m6502 Can you cite other text editors that support the behavior you'd like to see in Notepad++? |
Microsoft Visual Studio. CodeWarrior. Vim. And many more. |
Also, Notepad++ already supports it, with the modifications I did to my local copy of the code. |
Excellent, might you want to create a pull request for the change/additional setting? |
Hmm, my Microsoft Visual Studio doesn't seem to support it... IMO this isn't needed. |
Sure, that's the reason why I both opened this issue and #11443, which I also have working locally. But as this is the first time I contribute to this project I'm cautious. I want to be sure I don't break translations or resources, as I said in the other issue: #11443 (comment) |
This has been supported in Microsoft Visual Studio since the 90s. |
Maybe point out how to configure it to do it? |
I would say submit the PR for the code you have. |
To be honest I don't even remember ever having had to change anything to make it work that way. It's just the way it's ever worked for me, but I'll search for the specific option and post an update here. |
OK. |
OK, that was quick, just verified it with Microsoft Visual Studio 2022. It seems like Visual Studio disables the line wrapping when Virtual Space is enabled (which I always have) although I don't see why these two should be really related one to another. This would explain why @alankilborn wasn't seeing it work for him; I assume you don't have virtual space enabled. So to see it, in Visual Studio that's at menu Tools -> Options -> Left panel Text Editor -> All languages -> General -> Settings section -> Enable virtual space checkbox. |
To be honest I find these two features, the caret wrapping to the end or start of another line, and virtual space, to be two separate things and I don't know why Microsoft decided to group them. I have added two separate checkboxes, one for each feature, but if there's a good reason for them to be together and just disable the position warp if virtual space is enabled I can change it and submit only one pull request for both. |
Well, one thought on that would be if you're holding down the right arrow, moving infinitely into virtual space, there is no opportunity to ever get to the next line via this "wrapping". But, yea, really seem like unrelated features... So would you advocate a similar tying together of these features if both are implemented in Notepad++? Probably not. |
Oh, I see you already answered that with:
|
Maybe that's the reasoning behind it. Disabling the wrap completely when virtual space is enabled would ensure the behaviour is the same for both directions of horizontal movement: either it does wrap, or it doesn't. For the sake of completeness, I launched CodeWarrior and verified it does exactly the same: Virtual space and line wrapping go hand to hand there too. Seen that way I think it would make sense for me to rework this option into the virtual space mode and doing only one pull request. |
Description of the Issue
Caret moves to the previous or next line when moving left or right and reaching the start or the end of the lines. There's no easy way to change the behavior unless resorting to hacky methods.
Steps to Reproduce the Issue
Load or type some lines of text. Press left until reaching the start of a line, or right until reaching the end of a line. If there's any line before or after the current one the caret will wrap to the end of the previous line or the start of the next one. Open the settings menu and go to Preferences -> Editing. No option there.
Expected Behavior
Having a checkbox for this.
Actual Behavior
There's no checkbox for this.
Opening this issue as a prerequisite for an incoming pull request.
The text was updated successfully, but these errors were encountered: