Re: ViEmu Interaction with VS Macros

I am trying to write a VS macro that allows the user to select a piece of text and modify it by wrapping it in parens or somesuch

The macro runs but the selection triggers  visual mode and any characters added after that are interpreted as visual mode commands rather than being inserted.

I have not found a way to force insert mode

I tried to turn ViEmu on/off but I couldnt properly capture the commands  using the macro recorder.

Also,  I still have an outstanding question about using ViEmu in the Macro IDE

Thank you


Re: ViEmu Interaction with VS Macros


It would be helpful if you could post more details about the code of the macro, how you are invoking it, etc...

Auto-entering visual mode is a feature that helps get a smoother integration with built-in and other third party features. There is currently no way to disable it, but there can be alternate ways to insert text, etc... I'd really like to know more details about what you are doing before suggesting what the course of action may be. I'd be willing to look into providing better support for that kind of thing in ViEmu.

Also, turning ViEmu on and off is not scriptable, as the Ctrl-Shift-Alt-K keypress is detected natively in the editor window's subclassing, rather than via a VS keybinding.




Re: ViEmu Interaction with VS Macros


Thank you.

I worked on this some more and figured out that the core issue is that I didn't understand how macros work.

I was trying to write a macro that captured a single character from user input as a parameter.  To do this the macro enabled keypress events  with the idea that when the user typed in a character, the event handler would fire and complete the operation.   I realized that when the macro completes,  it returns control to ViEmu who now gets all the keystrokes and even though the eventhandler fires shortly after on the keypress  ViEmu is responding to the character input as well.

It would be nice to be able to write a macro that worked like  VIM command where one typed in the shortcut to invoke the macro followed by some characters  to specify the operation.  The only way I have found to do this is using the   Input()  dialog.


Re: ViEmu Interaction with VS Macros


You are right, this is a limitation in the current ViEmu model. I do plan to add ViEmu scripting in the future, but I haven't been able to so far. It's a complex issue and there are many other things before I can implement this, so it will take some time.

Still, I dream of the moment where the innards of the ViEmu vi parser and emulation engine can be customized and stuff like what you describe can be done.

I will post here and on the blog when something like this is available.


  -- Jon