visual mode with ex mode does not work

Bug #640890 reported by Stefan Bethge
6
This bug affects 1 person
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.lastCommand = None
        self.history = []
        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 :)

Revision history for this message
Stephen Moore (delfick) wrote :

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.

Changed in vigedit:
status: New → Triaged
Revision history for this message
Stefan Bethge (kjyv) wrote :

I'm quite busy too in the next days and weeks but I'll definitely have a look at some of the issues too :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.