OK, so I'll just use Geany to prepare a patch file for me. (duh!) Nice plugin!
One more note on operation. It handles typing fine (inserting & deleting) but won't paste some text in multiple lines. That would be nice; and a downstream goal.
The typing part is 95% of what I need to do anyway.
chuck
On Fri, 07 Mar 2008 14:28:47 -0800, chuck ctl@arrowtwins.com wrote:
OK, so I'll just use Geany to prepare a patch file for me. (duh!) Nice plugin!
Thanks for the patch. But could you give some more information about how to use? I'm not really sure what column mode editing means and how to use it ;-).
Regards, Enrico
Given a possibly stupid example of some code:
char *fill_1 = "Chapter 1"; char *bill_2 = "Chapter 2"; int yy; char *fooo_3 = "Chapter 3"; char *best_4 = "Chapter 4"; char *back_5 = "Chapter 5";
Suppose you want to change the variable names so they all have 2-digit numbers leading with a zero; so the first line would read char *fill_01 = "Chapter 1";
Position the cursor after the characters "fill_" on the first line. With the shift+alt and down keys, select z zero-width column to the right of the underscore. Select all the way from the top to the bottom.
Note that nothing will actually show at this point. Zero-width rectangular selections have no visual effect. (unfortunately)
Type a zero. -- it is inserted in all selected rows. Notice that since the 3rd row is too short, nothing happens to it. Were it as long as the selection point, it too would have had the insertion.
Suppose you make a mistake and accidentally type a 9 instead of a zero. No proplem, hit backspace and the 9s all go away, so you can then type the zero.
Additional example:
If you wanted to Chnage the word "Chapter" to "Section", you can either do a find/replace, or just select the column of "Chapter" and then type "Section".
The selection stays there until you move the cursor by arrow keys or the mouse.
The typing done in column mode is un-doable.
Cutting of a rectangular selection and then pasting of that selection into another rectangular selection will have unusual results if the number of rows is not the same in both.
Pasting of a single piece of text will not appear on all selected lines, only the first. Something I think should be there for completeness, but which I almost never need, so...
---------------------------------
I do a lot of work with table-oriented things so this edit mode is of prime importance to me. Build with it and try it out.
Enrico Tröger wrote:
On Fri, 07 Mar 2008 14:28:47 -0800, chuck ctl@arrowtwins.com wrote:
OK, so I'll just use Geany to prepare a patch file for me. (duh!) Nice plugin!
Thanks for the patch. But could you give some more information about how to use? I'm not really sure what column mode editing means and how to use it ;-).
Regards, Enrico
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Sun, 09 Mar 2008 14:07:00 -0700 chuck ctl@arrowtwins.com wrote:
Suppose you want to change the variable names so they all have 2-digit numbers leading with a zero; so the first line would read char *fill_01 = "Chapter 1";
Both examples could be done very easily with Geany using a column selection together with find+replace. IMO it's much better than a zero-width selection.
A nice feature for a "fill column selection" would be "auto-increment". So if I copy a variable several times, ...
char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1";
..it would be very handy to select the 1's as column block, press the magic key and all the 1's would be replaced like this. The auto-increment has to read the first character (the '1' in this case) and use this as starting point.
char *fill_1 = "Chapter 1"; char *fill_2 = "Chapter 1"; char *fill_3 = "Chapter 1"; char *fill_4 = "Chapter 1"; char *fill_5 = "Chapter 1";
This is just an idea. But I think this better should be plugin or a LUA script.
On Wed, 12 Mar 2008 07:50:55 +0100, Joerg Desch jd.vvd@web.de wrote:
On Sun, 09 Mar 2008 14:07:00 -0700 chuck ctl@arrowtwins.com wrote:
Suppose you want to change the variable names so they all have 2-digit numbers leading with a zero; so the first line would read char *fill_01 = "Chapter 1";
Both examples could be done very easily with Geany using a column selection together with find+replace. IMO it's much better than a zero-width selection.
A nice feature for a "fill column selection" would be "auto-increment". So if I copy a variable several times, ...
char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1"; char *fill_1 = "Chapter 1";
..it would be very handy to select the 1's as column block, press the magic key and all the 1's would be replaced like this. The auto-increment has to read the first character (the '1' in this case) and use this as starting point.
char *fill_1 = "Chapter 1"; char *fill_2 = "Chapter 1"; char *fill_3 = "Chapter 1"; char *fill_4 = "Chapter 1"; char *fill_5 = "Chapter 1";
This is just an idea. But I think this better should be plugin or a LUA script.
Or any other kind of script/program which can read text from stdin and print the changed text on stdout. Then you can use the "Send selection to" command in Geany(*). The only thing you have to do, is to write this script/program that handles the input, mangles it in some way and prints it out. Geany will take care of the selection handling.
(*) which should be used with care on Windows, it might work, it might fail.
Regards, Enrico
On Sun, 09 Mar 2008 14:07:00 -0700, chuck ctl@arrowtwins.com wrote:
Given a possibly stupid example of some code:
[example usage]
Ok, thanks for the good example. It's a bit funny, never seen this before ;-). If it doesn't break anything, we could add it even I personally probably won't use it ever. The only disadvantage is that it makes updating the embedded Scintilla sources a bit harder ;-(. Anyway, I won't work on the mentioned copy&paste problems.
So, if nobody has any objections I'll commit this code.
Additional example:
If you wanted to Chnage the word "Chapter" to "Section", you can either do a find/replace, or just select the column of "Chapter" and then type "Section".
The selection stays there until you move the cursor by arrow keys or the mouse.
The typing done in column mode is un-doable.
It works fine here, undo and redo. Tested with the "select chapter and type section" example.
Regards, Enrico
On Wed, 12 Mar 2008 10:12:26 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
On Sun, 09 Mar 2008 14:07:00 -0700, chuck ctl@arrowtwins.com wrote:
Given a possibly stupid example of some code:
[example usage]
Ok, thanks for the good example. It's a bit funny, never seen this before ;-). If it doesn't break anything, we could add it even I personally probably won't use it ever. The only disadvantage is that it makes updating the embedded Scintilla sources a bit harder ;-(. Anyway, I won't work on the mentioned copy&paste problems.
So, if nobody has any objections I'll commit this code.
Finally done. If anyone notice any problems with this or strange editing behaviour in general, please tell us.
Thanks chuck.
Regards, Enrico
Great. I have been using this patch for a long time without issues. In fact, I just used it yesterday to line up some code.
was: //allocating the colors $white = imagecolorallocate($canvas, 255, 255, 255); $red = imagecolorallocate($canvas, 255, 0, 0); $black = imagecolorallocate($canvas, 0, 0, 0); $yellow = imagecolorallocate($canvas, 248, 255, 190); $blue = imagecolorallocate($canvas, 3, 12, 94); $grey = imagecolorallocate($canvas, 102, 102, 102);
Added a new color... $lightGrey = imagecolorallocate($canvas, 216, 216, 216);
Did the zero-width rectangle in front of the first 6 '=' signs, typed a few spaces until it all lined up like:
//allocating the colors $white = imagecolorallocate($canvas, 255, 255, 255); $red = imagecolorallocate($canvas, 255, 0, 0); $black = imagecolorallocate($canvas, 0, 0, 0); $yellow = imagecolorallocate($canvas, 248, 255, 190); $blue = imagecolorallocate($canvas, 3, 12, 94); $grey = imagecolorallocate($canvas, 102, 102, 102); $lightGrey = imagecolorallocate($canvas, 216, 216, 216);
I think folks that try it will find it quite handy.
chuck
Enrico Tröger wrote:
On Wed, 12 Mar 2008 10:12:26 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
On Sun, 09 Mar 2008 14:07:00 -0700, chuck ctl@arrowtwins.com wrote:
Given a possibly stupid example of some code:
[example usage]
Ok, thanks for the good example. It's a bit funny, never seen this before ;-). If it doesn't break anything, we could add it even I personally probably won't use it ever. The only disadvantage is that it makes updating the embedded Scintilla sources a bit harder ;-(. Anyway, I won't work on the mentioned copy&paste problems.
So, if nobody has any objections I'll commit this code.
Finally done. If anyone notice any problems with this or strange editing behaviour in general, please tell us.
Thanks chuck.
Regards, Enrico
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
+1
On Sat, 15 Mar 2008 15:20:38 -0700 chuck ctl@arrowtwins.com wrote:
Great. I have been using this patch for a long time without issues. In fact, I just used it yesterday to line up some code.
was: //allocating the colors $white = imagecolorallocate($canvas, 255, 255, 255); $red = imagecolorallocate($canvas, 255, 0, 0); $black = imagecolorallocate($canvas, 0, 0, 0); $yellow = imagecolorallocate($canvas, 248, 255, 190); $blue = imagecolorallocate($canvas, 3, 12, 94); $grey = imagecolorallocate($canvas, 102, 102, 102);
Added a new color... $lightGrey = imagecolorallocate($canvas, 216, 216, 216);
Did the zero-width rectangle in front of the first 6 '=' signs, typed a few spaces until it all lined up like:
//allocating the colors $white = imagecolorallocate($canvas, 255, 255, 255); $red = imagecolorallocate($canvas, 255, 0, 0); $black = imagecolorallocate($canvas, 0, 0, 0); $yellow = imagecolorallocate($canvas, 248, 255, 190); $blue = imagecolorallocate($canvas, 3, 12, 94); $grey = imagecolorallocate($canvas, 102, 102, 102); $lightGrey = imagecolorallocate($canvas, 216, 216, 216);
I think folks that try it will find it quite handy.
chuck
Enrico Tröger wrote:
On Wed, 12 Mar 2008 10:12:26 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
On Sun, 09 Mar 2008 14:07:00 -0700, chuck ctl@arrowtwins.com wrote:
Given a possibly stupid example of some code:
[example usage]
Ok, thanks for the good example. It's a bit funny, never seen this before ;-). If it doesn't break anything, we could add it even I personally probably won't use it ever. The only disadvantage is that it makes updating the embedded Scintilla sources a bit harder ;-(. Anyway, I won't work on the mentioned copy&paste problems.
So, if nobody has any objections I'll commit this code.
Finally done. If anyone notice any problems with this or strange editing behaviour in general, please tell us.
Thanks chuck.
Regards, Enrico
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Sat, 15 Mar 2008 15:20:38 -0700 chuck ctl@arrowtwins.com wrote:
Great. I have been using this patch for a long time without issues. In fact, I just used it yesterday to line up some code.
Thanks chuck.
The only disadvantage is that it makes updating the embedded Scintilla sources a bit harder ;-(.
It would be great if this got into the Scintilla mainline, but I agree with them that drawing a line to indicate the zero-width column selection would be clearer.
Regards, Nick
On Fri, 07 Mar 2008 14:28:47 -0800 chuck ctl@arrowtwins.com wrote:
One more note on operation. It handles typing fine (inserting & deleting) but won't paste some text in multiple lines. That would be nice; and a downstream goal.
But Scintilla by default handles pasting a column selection, and I use this from time to time. It sounds like your code breaks this - if this is the case IMO we shouldn't apply it. Any patch should extend the existing Scintilla functionality, without disabling/breaking anything.
Disclaimer: I haven't tried the patch yet ;-)
Regards, Nick
No My patch does not break it.
You can still paste a rectangular chunk and it works just as before.
But if a rectangular selection is active and a single, non-block string of text is in the clipboard, it will only paste in the first line of the rectangular selection. This is just as it is now.
What I was saying is that it would be nice if the single item of text that had been previously Copied or Cut would be replicated on every line of the rectangular selection. That is the extension of column mode that I think would make it complete.
chuck
Nick Treleaven wrote:
On Fri, 07 Mar 2008 14:28:47 -0800 chuck ctl@arrowtwins.com wrote:
One more note on operation. It handles typing fine (inserting & deleting) but won't paste some text in multiple lines. That would be nice; and a downstream goal.
But Scintilla by default handles pasting a column selection, and I use this from time to time. It sounds like your code breaks this - if this is the case IMO we shouldn't apply it. Any patch should extend the existing Scintilla functionality, without disabling/breaking anything.
Disclaimer: I haven't tried the patch yet ;-)
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On Tue, 11 Mar 2008 11:46:38 -0700 chuck ctl@arrowtwins.com wrote:
No My patch does not break it.
You can still paste a rectangular chunk and it works just as before.
But if a rectangular selection is active and a single, non-block string of text is in the clipboard, it will only paste in the first line of the rectangular selection. This is just as it is now.
What I was saying is that it would be nice if the single item of text that had been previously Copied or Cut would be replicated on every line of the rectangular selection. That is the extension of column mode that I think would make it complete.
OK, I wasn't sure, thanks for explaining. That might be a nice feature, but of course it's not necessary ;-)
Regards, Nick