-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 support for S #546
Add support for S #546
Conversation
keys = ["S"]; | ||
|
||
public async exec(position: Position, vimState: VimState): Promise<VimState> { | ||
const lineStart = position.getFirstLineNonBlankChar(); |
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.
Why firstLineNonBlankChar? S eats up the whole line, start to end.
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.
@johnfn That wasn't my understanding from #536, or from my usage of vim.
For example, consider a sample function:
def func(one, two):
print o|ne
print two
By pressing S
I would expect to replace the second line with the correct indent, which this accomplishes.
Just nuking the whole line seems less useful, and not what my terminal vim does.
I'm happy to change to first char, but is that really desired?
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.
@johnfn did some more testing and digging through manuals. c-c
aka S
is defined to "replace the whole line".
However, my 7.3 VIM and Atom vim-plus replace to the first non-blank character as I have described.
VSCode c-c
does the whole line replace. In order to be consistent within VSCode, we should either make S
do whole line, or update c-c
to point to first non-white.
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.
My two cents here:
I think right now you just keep |
Lastly, please update the roadmap about |
👍 on what @rebornix said. Also, if you want you could do numeric prefixes on S as well. Not a requirement for getting this pulled in - we can always do it later, of course. |
@rebornix Thank you for the explanation, that makes total sense. Completely forgot about the I'll change this PR for |
Ready to merge? |
@johnfn ready if you are. |
Looks great to me. Props on doing the numeric prefix as well! :-) |
... Oh wait, there are merge conflicts. Could you fix those? Then we will really be good to go. 😛 |
Whoops. Yeah, let me fix those |
@johnfn should be good to go now without conflicts. |
Awesome! Thanks, @glibsm! |
Thanks for this. But there's still one more thing. Not sure if i should put this here, but the implementation of shift+S doesn't match standard VIM. Shift+S adds indentation, in vscodevim it does not. So if if i'm inside a function like this:
|
@mnsr could you please open up an issue for that bug? Thanks. :) |
@johnfn yeah np |
As discussed earlier, it's a bug with auto indent. Has it been fully implemented already? |
@glibsm sorry for the late response and yes, it's already covered by #629. Kudos to @sectioneight . |
Ha, small world. @glibsm and I sit right next to each other at work :) |
Fixes #536