Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Option to not select the symbol after goto

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
kcbanner Posted - Oct 28 2024 : 3:29:39 PM
I am a user of VsVim, and I have defined the following commands in my .vsvimrc:

nnoremap gd :vsc VAssistX.GotoImplementation<CR>
nnoremap gi :vsc VAssistX.GotoImplementation<CR>
vnoremap gd :vsc VAssistX.GotoImplementation<CR>
vnoremap gi :vsc VAssistX.GotoImplementation<CR>

This works well, and allows navigation with standard vim bindings. However, upon navigating to the symbol, it it selected. Selections like this cause VsVim to enter Visual mode (which is Vim's mode for selection editing) which requires an extra keystroke to leave. This means whenever I navigate somewhere using these bindings I need to hit Esc to enter Normal mode and resume navigating around the file.

My request is for an option to not select the symbol upon navigating to it via VAssistX commands.

Thanks!
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 01 2024 : 07:58:55 AM
I will have to have a prod of this. But the movement going to the wrong buffer suggests that the macro is being run "instantly", and not waiting for one command to finish before triggering the next command. That seems like it will be a standard problem that has a fix, since surely VsVim cannot expect all IDE commands to return "instantly" without having an effect on the buffer?
kcbanner Posted - Oct 31 2024 : 5:30:06 PM
Good ideas!

Indeed, I had enabled "Prefer implemention on Goto" to avoid the menu.

I tried the left cursor idea, but it ends up moving the cursor left in the buffer that the action was executed in, not the destination.

Additionally, I tried:

nnoremap gd :vsc VAssistX.GotoImplementation<CR>:vsc Edit.SelectNone<CR>

thinking that the commands would execute sequentially, but this didn't work either.

feline Posted - Oct 31 2024 : 08:29:59 AM
Can you try sending a move left one space instead of Escape? If you use the left cursor key after Alt-G then you end up with the keyboard caret at the start of the symbol you jumped to, with nothing selected. So it should have the same general result as an escape, but perhaps it will be more effective?

Is there a delay command? I am wondering if you need to add a slight delay, to make sure that VA has finished the Alt-G command, before VsVim picks up again.

If we can easily get this working it will be a lot faster than waiting for a code change in VA. Plus, from going looking, this behaviour in VA was done deliberately to match what the IDE its self does when jumping to commands, so a solution might be more widely helpful.

On this front, how are you handling cases where Alt-G shows you a menu? Or did you turn On

VA Options -> Goto -> Prefer implementation on Goto

to avoid running into a menu?
kcbanner Posted - Oct 30 2024 : 12:40:02 PM
Actually that was also my first though, and I did attempt to expand the macro I'm using above by adding an <ESC> to the sequence (to exit visual mode after the togo). However, this didn't work as I believe there is something async happening with either the goto call itself, or the way that VsVim calls commands via :vsc.

There was a brief discussion here about it https://github.com/VsVim/VsVim/issues/891#issuecomment-2442397296

Once I determined that I couldn't solve it via extending the binding with <ESC>, then I thought perhaps an options to disable the automatic selection would be a good workaround.
feline Posted - Oct 29 2024 : 07:50:20 AM
I haven't used Vim in years, and never did wrap my head around using VsVim, since to me Visual Studio and Vim just work in very different ways

I can sort of read this... is this moving into Vim macro territory? Assuming the <CR> at the end of each line is part of the command you are sending, can't you just add an escape at this point? I seem to recall that Vim macros got rather powerful, since you could just chain together the commands you wanted running as a single block. Or am I thinking of something quite different?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000