vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question regarding `c' operator acting on rectangular region


From: Paul Fox
Subject: Re: question regarding `c' operator acting on rectangular region
Date: Sat, 27 May 2023 07:27:57 -0400

joerg van den hoff wrote:
 > rarely using rectangular regions (and when, then for deletion), so
 > I was surprised by the following:
 > 
 > issuing something like
 > 
 > c^Aqjq
 > 
 > to select a rectangle with a width of one character and a height of
 > 2 lines and trying to replace the rectangle by a multicharacter
 > string fails.  only the first character of the replacement string
 > specified in response to the "Rectangular text:" query is inserted.
 > 
 > e.g. with an input of
 > 
 > 1 2 3
 > 1 2 3
 > 
 > and selecting the 2nd column as rectangle and trying to replace the
 > 2s by "abc" results in
 > 
 > 1 a 3
 > 1 a 3
 > 
 > I would have expected the text to the right of the rectangle to be
 > shifted to the right to make room for the full replacement string?
 > 
 > questions:
 > 
 > * am I doing it wrong?

I'm afraid not.  This is the current behavior.

 > 
 > * if no, is this to be expected behaviour or a bug?
 > 
 > * if not a bug, is there a canonical way to achieve the desired
 > * edit result, i.e.
 > 
 > 1 abc 3
 > 1 abc 3

No easy way.  I find myself using ^A-r to open a rectangle with the
right amount of space (and it's usually too much :-/ ), then put in
the text I want, then delete the extra, if any.  I don't know how hard
it would be internally to force the new empty space in order to make
room for the new string.  Currently if the new text is shorter than
the rectangle width, it's padded with spaces -- to be consistent, the
rectangle should probably be shrunk to match the string length.

I seem to recall I wasn't terribly happy with the way the rectangular
operations turned out, after implementing them, and I think this was
part of it.

paul

 > 
 > in this example?
 > 
 > thank you
 > joerg
 > 


=----------------------
paul fox, pgf@foxharp.boston.ma.us (arlington, ma)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]