Re: [Patch] Re: copy rectangle with short lines

2010-02-22 Thread Nicholas Marriott
Awesome, committed, thanks. On Thu, Feb 18, 2010 at 07:53:44PM -0800, Micah Cowan wrote: > clemens fischer wrote: > > Hi, > > > > I am very glad that tmux has rectangular copies now! But a problem as > > well: in the following, try to cut out the block > > > > >bbb < from >aaa bbb > >

Re: copy rectangle with short lines

2010-02-22 Thread Nicholas Marriott
On Fri, Feb 19, 2010 at 09:55:06AM -0800, Robin Lee Powell wrote: > You keep saying that, and it took me a while to figure out what you > meant, so let me expand. > > In screen, the exact work flow was: > > hilight a selection > > convert the newlines in the selection to something else > >

Re: copy rectangle with short lines

2010-02-22 Thread Nicholas Marriott
On Fri, Feb 19, 2010 at 09:59:47PM +0100, clemens fischer wrote: > Robin Lee Powell wrote: > > > On Fri, Feb 19, 2010 at 05:25:36PM +0100, clemens fischer wrote: > > > >> What I have in mind is something special for any selection and would > >> only apply to copy-mode: a per-window (per-pane?) opt

Re: copy rectangle with short lines

2010-02-19 Thread Nicholas Marriott
Hi You are pretty much right, sorry if I wasn't clear. I think the "convert" bit should be done at the same time as paste. So copy-mode always sticks the same stuff in the buffer (NOT necessarily what it does now if other forms are easier), but it can be pasted in various different ways. I don'

Re: copy rectangle with short lines

2010-02-19 Thread clemens fischer
Robin Lee Powell wrote: > On Fri, Feb 19, 2010 at 05:25:36PM +0100, clemens fischer wrote: > >> What I have in mind is something special for any selection and would >> only apply to copy-mode: a per-window (per-pane?) option in a special >> struct hanging off of "struct window"(?), roughly: >> >>

Re: copy rectangle with short lines

2010-02-19 Thread clemens fischer
Robin Lee Powell wrote: > In screen, the exact work flow was: > > hilight a selection > > convert the newlines in the selection to something else > > copy the selection > > paste the selection > > I think what you're asking for is this work flow: > > copy a selection > > convert the n

Re: [Patch] Re: copy rectangle with short lines

2010-02-19 Thread Micah Cowan
clemens fischer wrote: > High quality indeed, and works as expected! Thank you very much, Micah! > One question: it applied with offsets to portable HEAD from yesterday: > How come? I wrote it to apply after the last couple patches I'd recently submitted. I figured it would apply without them

Re: copy rectangle with short lines

2010-02-19 Thread Robin Lee Powell
On Fri, Feb 19, 2010 at 05:25:36PM +0100, clemens fischer wrote: > What I have in mind is something special for any selection and would > only apply to copy-mode: a per-window (per-pane?) option in a special > struct hanging off of "struct window"(?), roughly: > > struct selection_op { >

Re: copy rectangle with short lines

2010-02-19 Thread Robin Lee Powell
You keep saying that, and it took me a while to figure out what you meant, so let me expand. In screen, the exact work flow was: hilight a selection convert the newlines in the selection to something else copy the selection paste the selection I think what you're asking for is this wo

Re: copy rectangle with short lines

2010-02-19 Thread Nicholas Marriott
I think the place for deciding how lines should be joined is in paste-buffer or save-buffer (they can use common code if necessary), not in the copy mode. On Fri, Feb 19, 2010 at 05:25:36PM +0100, clemens fischer wrote: > Robin Lee Powell wrote: > > > Copying from my other post: > > > > The oth

Re: [Patch] Re: copy rectangle with short lines

2010-02-19 Thread clemens fischer
Micah Cowan wrote: > clemens fischer wrote: > >> Hi, >> >> I am very glad that tmux has rectangular copies now! But a problem >> as well: in the following, try to cut out the block >> >> >bbb < from >aaa bbb >> >y< >xxx y >> >22 < >111 22 >> >> At least in

Re: copy rectangle with short lines

2010-02-19 Thread clemens fischer
Robin Lee Powell wrote: > Copying from my other post: > > The other aspect to it is having a key that can shift between the > various options. My idea there is to store the > pass-through-before-pasting command in a (window?) option, and make > a tmux command that takes an option name and a list

Re: copy rectangle with short lines

2010-02-19 Thread clemens fischer
Micah Cowan wrote: > The following should bind J to join the current (already > finished) selection with spaces: > > bind-key J run-shell 'tmux save-buffer /tmp/.tmux-exchange; tr \n " " < > /tmp/.tmux-exchange >/tmp/.tmux-exchange-processed; tmux load-buffer > /tmp/.tmux-exchange-processed' I

[Patch] Re: copy rectangle with short lines

2010-02-18 Thread Micah Cowan
clemens fischer wrote: > Hi, > > I am very glad that tmux has rectangular copies now! But a problem as > well: in the following, try to cut out the block > > >bbb < from >aaa bbb > >y< >xxx y > >22 < >111 22 > > At least in vi-copy mode on linux, the shor

Re: copy rectangle with short lines

2010-02-18 Thread Robin Lee Powell
On Thu, Feb 18, 2010 at 11:05:27PM +, Nicholas Marriott wrote: > On Thu, Feb 18, 2010 at 02:59:44PM -0800, Robin Lee Powell wrote: > > I'm lost; what options would it rotate through, exactly, and how > > would that be determined? > > Eg mode-keys has options "vi" and "emacs", "setw mode-keys"

Re: copy rectangle with short lines

2010-02-18 Thread Nicholas Marriott
On Thu, Feb 18, 2010 at 02:59:44PM -0800, Robin Lee Powell wrote: > On Thu, Feb 18, 2010 at 10:51:06PM +, Nicholas Marriott wrote: > > On Thu, Feb 18, 2010 at 02:36:06PM -0800, Robin Lee Powell wrote: > > > On Thu, Feb 18, 2010 at 02:25:08PM -0800, Micah Cowan wrote: > > > > > Now we just need

Re: copy rectangle with short lines

2010-02-18 Thread Nicholas Marriott
Ah okay, I thought he was talking about something used from copy-mode. On Thu, Feb 18, 2010 at 02:57:51PM -0800, Robin Lee Powell wrote: > Isn't that what Micah's solution does? If not, I'm missing > something. > > -Robin > > On Thu, Feb 18, 2010 at 10:52:01PM +, Nicholas Marriott wrote: >

Re: copy rectangle with short lines

2010-02-18 Thread Robin Lee Powell
On Thu, Feb 18, 2010 at 10:51:06PM +, Nicholas Marriott wrote: > On Thu, Feb 18, 2010 at 02:36:06PM -0800, Robin Lee Powell wrote: > > On Thu, Feb 18, 2010 at 02:25:08PM -0800, Micah Cowan wrote: > > > > Now we just need the rotating behaviour of J (see my other > > > > post). > > > > > > Well

Re: copy rectangle with short lines

2010-02-18 Thread Robin Lee Powell
Isn't that what Micah's solution does? If not, I'm missing something. -Robin On Thu, Feb 18, 2010 at 10:52:01PM +, Nicholas Marriott wrote: > > I think the place for deciding how things should appear when they are pasted > is > in paste-buffer or save-buffer not in copy mode. > > > On Th

Re: copy rectangle with short lines

2010-02-18 Thread Nicholas Marriott
On Thu, Feb 18, 2010 at 01:39:15PM -0800, Micah Cowan wrote: > clemens fischer wrote: > > Hi, > > > > I am very glad that tmux has rectangular copies now! But a problem as > > well: in the following, try to cut out the block > > > > >bbb < from >aaa bbb > > >y< >xxx y

Re: copy rectangle with short lines

2010-02-18 Thread Nicholas Marriott
Hi I think the place for deciding how things should appear when they are pasted is in paste-buffer or save-buffer not in copy mode. On Thu, Feb 18, 2010 at 02:25:08PM -0800, Micah Cowan wrote: > Robin Lee Powell wrote: > > On Thu, Feb 18, 2010 at 01:39:15PM -0800, Micah Cowan wrote: > >> The fol

Re: copy rectangle with short lines

2010-02-18 Thread Nicholas Marriott
Hi On Thu, Feb 18, 2010 at 02:36:06PM -0800, Robin Lee Powell wrote: > On Thu, Feb 18, 2010 at 02:25:08PM -0800, Micah Cowan wrote: > > > Now we just need the rotating behaviour of J (see my other > > > post). > > > > Well, you could of course still rig that up through run-shell, and > > some sor

Re: copy rectangle with short lines

2010-02-18 Thread Robin Lee Powell
On Thu, Feb 18, 2010 at 02:25:08PM -0800, Micah Cowan wrote: > > Now we just need the rotating behaviour of J (see my other > > post). > > Well, you could of course still rig that up through run-shell, and > some sort of flag-file. But personally, I don't like the rotating > behavior of J: better

Re: copy rectangle with short lines

2010-02-18 Thread Micah Cowan
clemens fischer wrote: > clemens fischer wrote: > >> I am very glad that tmux has rectangular copies now! But a problem as >> well: in the following, try to cut out the block >> >> >bbb < from >aaa bbb >> >y< >xxx y >> >22 < >111 22 >> >> At least in vi-copy m

Re: copy rectangle with short lines

2010-02-18 Thread Micah Cowan
Robin Lee Powell wrote: > On Thu, Feb 18, 2010 at 01:39:15PM -0800, Micah Cowan wrote: >> The following should bind J to join the current (already >> finished) selection with spaces: >> >> bind-key J run-shell 'tmux save-buffer /tmp/.tmux-exchange; tr \n >> " " < /tmp/.tmux-exchange >/tmp/.tmux-ex

Re: copy rectangle with short lines

2010-02-18 Thread Robin Lee Powell
On Thu, Feb 18, 2010 at 01:39:15PM -0800, Micah Cowan wrote: > The following should bind J to join the current (already > finished) selection with spaces: > > bind-key J run-shell 'tmux save-buffer /tmp/.tmux-exchange; tr \n > " " < /tmp/.tmux-exchange >/tmp/.tmux-exchange-processed; tmux > load-

Re: copy rectangle with short lines

2010-02-18 Thread Robin Lee Powell
On Thu, Feb 18, 2010 at 09:07:00PM +0100, clemens fischer wrote: > The other problem: for my purposes, I used to rely on screens > ability to 'J'oin the lines of any selection by either spaces, > commas, newlines (the default) or whatnot, ie. to make one long > line of the selected lines. For exa

Re: copy rectangle with short lines

2010-02-18 Thread clemens fischer
clemens fischer wrote: > I am very glad that tmux has rectangular copies now! But a problem as > well: in the following, try to cut out the block > > >bbb < from >aaa bbb > >y< >xxx y > >22 < >111 22 > > At least in vi-copy mode on linux, the shortest line d

Re: copy rectangle with short lines

2010-02-18 Thread Micah Cowan
clemens fischer wrote: > Hi, > > I am very glad that tmux has rectangular copies now! But a problem as > well: in the following, try to cut out the block > > >bbb < from >aaa bbb > >y< >xxx y > >22 < >111 22 > > At least in vi-copy mode on linux, the shor