visual mode with ex mode does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ViGedit |
Triaged
|
Undecided
|
Unassigned |
Bug Description
As started in another ticket, first selecting some lines with shift-v and then pressing : for ex mode to do things on the selection does is not possible. In vim, it is possible to replace things that way and probably some more nice things I'm not aware of atm.
An example:
def __init__(self, act, options=None):
self.index = -1
If I want to replace all occurences of self with myself, I could shift-v, select all lines and then press :
that would prefill the status bar with :'<,'> (don't really know if that need to be replicated). Then typing after it something like
s/self/myself/ will nicely do our sustitution. Another nice trick is adding or deleting comments that way (s/^/#/)
Basically looping through the lines and executing the command for each should do the trick. It seems though that vim has different behaviour for different commands, selecting a few lines and doing :'<,'>w test will save the selected lines in a new file.
So maybe the python implementation of the command should get all the lines and decide what to do with it.
Would be very nice :)
Fair enough.
I think what I would do is change the way /actions/ ex.py/exManager /evaluate works to look for a range before looking for the function to execute for the rest of the command, and pass this information into that function if it finds one.
Unfortunately, I must focus on uni study again for a while and I'll do this later.