-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Change of behavour of Right command for 1 space at the start of line #242
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
447141a
Change of behavour of Right command for spaces at the start of line
Marsma13 037ed89
Change behavior for tabs in editor
Marsma13 c4ef375
Cleanup of comments and some condition
Marsma13 6d135bb
Change behaviour for ^right with tabs
Marsma13 31c80fe
Merge branch 'right_command' of github.com:Marsma13/babi into right_c…
Marsma13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is sufficient -- the same problem would happen halfway through an indent if I understand correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think of case when we have \t\tSome words
And when we are on the 2nd tab we will jump to the end of "Some" word. I done it the same as spaces works, if you are on the space before the word you jump at the end of the word, and that is included in test. If you think behaviour should be different i can think of solution. I do not want to differentitate behaviour for space and space like chcaracters ( tab ) included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or cursor is at position 3 of a 4 space tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so you have in maind case when we have characters in intedn from tab? I still do not know what is expected behaviour from this.
You want to treat \t as 4 spaces and it should work the same? so when we have situatuation like this:
Do you want to override default behavior and when we have words separated by tab we should go to the start od the word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I think I understand what you are thinking off. I will try to solve that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that doesn't look like the right direction at all. I suspect what actually should be done is to find the "break" points in the line and navigate to the next one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Understand but without knowing the width of the tab, i do not think that I will be able to determine if i should go to the begginig of the word or the postion after the word. Let look at examples:
I could use buf.x to differentiate that but problem is when we have something like that:
In that case we have just bad value in buf.x which is not corresponding to the screen position.
Question is if we have left with one "space" when using tab should we jump to the nearest word (easy fix) or to the space after the word ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the width of the tab doesn't matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. So you want it working like in nano? So when tab is used it is alweys go to the start of the next word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I make it the most trivial now how it can be. I do not really get the better idea of how to find break points without knowing the tab lenght. Current solution resolve most cases except one when we have something like that:
asd\tasd -> it will go to the a of the asd instead of the end. But i do not really know how i should find if we should go after the word or not without knowing the tab size and counting characters in the string.