Re: Global Replace with Confirm

It doesn't appear to me that the global search and replace command allows for confirmations.

Example :%s/good/better/gc

In Vim this would prompt me for each replacement and give the choice to replace or skip over. This is something I miss but otherwise I'm very happy with ViEmu.



Re: Global Replace with Confirm


You are right. The confirm flag is not yet implemented. The reason is that it is pretty hard to do it the 'vi[m]' way, that is, with the question at the bottom and a non intrusive way - it involves turning ViEmu's key handling architecture upside down.

Doing it with an intrusive messagebox would be much more doable though. I haven't done it because I thought nobody would like it. Do you think this would work until it's really ready?

Thanks for the feedback!


Re: Global Replace with Confirm

I see what you mean. I appreciate your desire to keep ViEmu as close to vi[m] as possible. I'm not sure about others but I think the messagebox could be done in a way that would work. Here is how I would like to see it.

The focus of the window would have to jump to each instance found because being able to see the context of the instance is important.

The item found would have to be highlighted so you know exactly what you are replacing. The messagebox can't hide what you are replacing.

The messagebox should give you the same options as VIM.

    y        Yes; make this change.
    n        No; skip this match.
    a        All; make this change and all remaining ones without further confirmation.
    q        Quit; don't make any more changes.
    l        Last; make this change and then quit.
    CTRL-E        Scroll the text one line up.
    CTRL-Y        Scroll the text one line down.

Thanks for considering this.


Re: Global Replace with Confirm

Thanks for the detailed feedback. I'm not sure I can implement the scrolling options from a modal dialog, but I'll give it a try. I'll let you know when I have something ready (most probably, in one of the alphas/betas of the next major version).


Re: Global Replace with Confirm

Looks like the answer here is over three years old, but it appears that this feature was never implemented.  Did you decide against it?


Re: Global Replace with Confirm


Indeed, this is an long-outstanding issue and I still haven't implemented it. The reason is not that I decided against it, but that many other things got in the way (and it's not a simple feature to implement, due to ViEmu's and VS's input-event handling architecture).

Anyway, this is the top-priority feature right now on the todo list, and I plan to include it in ViEmu/VS 2.5, but I want to implement the new licensing system first. In any case, I really think it will be available at some point during the year.

Best regards,

  -- Jon