[vitunes] Re: [PATCH] add visual mode to vitunes

  • From: Daniel Walter <sahne@xxxxxxx>
  • To: vitunes@xxxxxxxxxxxxx
  • Date: Fri, 11 Feb 2011 07:34:07 +0000

On Thu, Feb 10, 2011 at 08:13:12PM -0500, Ryan Flannery wrote:
> On Thu, Feb 10, 2011 at 8:03 PM, Ryan Flannery <ryan.flannery@xxxxxxxxx> 
> wrote:
> > Hi Daniel,
> >
> > On Thu, Feb 10, 2011 at 7:40 PM, Ryan Flannery <ryan.flannery@xxxxxxxxx> 
> > wrote:
> >> Hi Daniel!
> >>
> >> On Thu, Feb 10, 2011 at 7:18 PM, Daniel Walter <sahne> wrote:
> >>> Hi all,
> >>>
> >>> I've hacked a visual mode patch for vitunes, which allows you to vim like 
> >>> select files within a playlist and
> >>> copy or delete/cut them.
> >>
> >> Sweeeeet! ?I've been wanting something like this for a while!
> >>
> >>> It basically works like visual mode in vim, so you enable it via 'V' and 
> >>> use either 'UP'/'DOWN' or 'j'/'k' to
> >>> select the files you like to copy or delete.
> >>>
> >>> In this first version the is no support for jumping to the beginning or 
> >>> end of a list, but I'm planning to
> >>> integrate this within a few days.
> >>
> >> Hmm.. I'm thinking there might be an easier way to add support for all
> >> of these (like gg, G, ^u, ^d, 123G, etc.), in one shot.
> >>
> >> What about the following:
> >>
> >> In the kba_visual, just do:
> >> if (visual_selection_start == -1)
> >> ? ? visual_selection_start = ui.active->voffset + ui.active->crow;
> >> else
> >> ? ? visual_selection_start = -1;
> >>
> >>
> >> The visual_selection_end, I think, could always just be:
> >> ? ? ui.active->voffset + ui.active->crow;
> >> so I wouldn't even track that.... just let the other keybinding
> >> handlers modify that as they normally do.
> >>
> >>
> >> In the paint code, a row gets the A_REVERSE wattron'd if and only if
> >> the row is between
> >> ? ? visual_selection_start
> >> and
> >> ? ? ui.active->voffset + ui.active->crow;
> >> and the visual_selection_start is != -1 of course.
> >>
> >>
> >> With that, yank could then be updated to use the
> >> visual_selection_start (if != -1) and current row to get the
> >> yank-portion.
> >>
> >>
> >> Thoughts?
> >>
> >
> > Attached is a diff with just the tracking and painting, which is
> > rough, but I think it illustrates what I'm talking about.
> >
> 
> And it appears freelists.org stripped my patch....  Here it is:
> 
> 
> 
Hi,

hmm, okay so I did it way too complicated ;)
I like your patch, since it seems to be a much nicer way to
integrate all other commands, like scrolling down the hole page, etc.
I'll spend some time on it, when I'm back home, but I could see any 
problems on the first, quick look.


daniel

Other related posts: