Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Lex Trotman
[...] This style of auto-indentation requires Option 1 or 2 (calculate for each change), because it unindents the 'end', 'elsif' and 'else' keywords as soon as their last characters are pressed. I did find this behavior very useful, even though I admit that it would sometimes destroy my

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Nathan Broadbent
Actually the plugin is option 3,   It is return plus user activated, just some activations are normal keys. Aha, I understand. Thanks for the explanation. Maybe it works for Ruby, but it doesn't for C, and after looking at the code I don't see how it can possibly generate GNU style

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Jiří Techet
On Tue, Dec 6, 2011 at 07:20, Lex Trotman ele...@gmail.com wrote: [...] First, note that I wasn't able to find the patch, so I'm only guessing from reading the thread and from my own (much less complete) attempt. I'm afraid that if I had the patch it is on my broken hard drive :-S And

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Jiří Techet
On Tue, Dec 6, 2011 at 08:27, Nathan Broadbent nathan@gmail.com wrote: 1. calculate the indent each change, and then ripple that through the file 2. calculate the indent each change and only apply it to this line 3. calculate and apply the indent to lines N and N-1 only on new line or user

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Lex Trotman
[...] Maybe I don't understand it correctly but does this mean that if you open an existing file, you'd re-indent it completely based on the regexes? I don't think this is a good idea because this could lead to whitespace change in every line when you edit just a single line. No, thats

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Lex Trotman
[...] This is exactly what my regex-based indentation did and I assume what Colomban's experiment does too. The problem Colomban was trying to resolve was what to do when you have an end-block keyword fi which should unindent and then have an identifier file (notice the fi prefix) which

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Colomban Wendling
Le 06/12/2011 07:20, Lex Trotman a écrit : [...] First, note that I wasn't able to find the patch, so I'm only guessing from reading the thread and from my own (much less complete) attempt. I'm afraid that if I had the patch it is on my broken hard drive :-S And anyway we never got it

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Lex Trotman
[...] What do you mean here with the indent versus a delta?  If the new indent's value is not count in current indent + something * indent size (where here current indent is previous line's indent) I don't see how this would possibly fit with configured indent sizes, nor what's the

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Jiří Techet
On Tue, Dec 6, 2011 at 21:56, Lex Trotman ele...@gmail.com wrote: [...] Maybe I don't understand it correctly but does this mean that if you open an existing file, you'd re-indent it completely based on the regexes? I don't think this is a good idea because this could lead to whitespace

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Lex Trotman
On Wed, Dec 7, 2011 at 11:06 AM, Jiří Techet tec...@gmail.com wrote: On Tue, Dec 6, 2011 at 21:56, Lex Trotman ele...@gmail.com wrote: [...] Maybe I don't understand it correctly but does this mean that if you open an existing file, you'd re-indent it completely based on the regexes? I don't

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-06 Thread Matthew Brush
Nevermind, I need to better RTFM: `Preferences-Editor-Features-Newline strips trailing spaces` seems to do exactly what I was talking about (awesome!). Sorry for the noise Cheers, Matthew Brush On 12/06/2011 06:06 PM, Matthew Brush wrote: On 12/05/2011 10:30 AM, Colomban Wendling wrote:

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-05 Thread Colomban Wendling
Hi, I know this is a more than one year old discussion, but I was messing with a very similar thing a few minutes ago when wanting to add autoindent support for SH. Le 16/09/2010 22:17, Jiří Techet a écrit : On Thu, Sep 16, 2010 at 19:27, Thomas Martitz thomas.mart...@student.htw-berlin.de

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-05 Thread Jiří Techet
On Mon, Dec 5, 2011 at 19:30, Colomban Wendling lists@herbesfolles.org wrote: Hi, I know this is a more than one year old discussion, but I was messing with a very similar thing a few minutes ago when wanting to add autoindent support for SH. Le 16/09/2010 22:17, Jiří Techet a écrit :

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-05 Thread Lex Trotman
[...] First, note that I wasn't able to find the patch, so I'm only guessing from reading the thread and from my own (much less complete) attempt. I'm afraid that if I had the patch it is on my broken hard drive :-S And anyway we never got it to work satisfactorily. So.  This looks pretty

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2011-12-05 Thread Nathan Broadbent
1. calculate the indent each change, and then ripple that through the file 2. calculate the indent each change and only apply it to this line 3. calculate and apply the indent to lines N and N-1 only on new line or user command 4. calculate and apply the indent on user command Option 1 is

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-10-25 Thread Lex Trotman
But it doesn't seem to be working as expected. Using only the first two of your regexes the following gets: class foo {    struct bar {        int i;    };    } This works for me - if you press }, it should get unindented. How did you enter the code (copy-paste or something like that)?

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-22 Thread Jiří Techet
Hi Lex, On Tue, Sep 21, 2010 at 02:41, Lex Trotman ele...@gmail.com wrote: Hi Jiri, Got it working, I'd put the regexes in the filetypes in the wrong prefix, my mistake :-D But it doesn't seem to be working as expected. Using only the first two of your regexes the following gets: class

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-22 Thread Jiří Techet
On Tue, Sep 21, 2010 at 03:10, Lex Trotman ele...@gmail.com wrote: Hi Jiri, Got it working, I'd put the regexes in the filetypes in the wrong prefix, my mistake :-D But it doesn't seem to be working as expected. Using only the first two of your regexes the following gets: class foo {  

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-22 Thread Jiří Techet
On Wed, Sep 22, 2010 at 13:47, Lex Trotman ele...@gmail.com wrote: On 22 September 2010 20:47, Jiří Techet tec...@gmail.com wrote: Hi Lex, On Tue, Sep 21, 2010 at 02:41, Lex Trotman ele...@gmail.com wrote: Hi Jiri, Got it working, I'd put the regexes in the filetypes in the wrong prefix,

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-22 Thread Lex Trotman
Welcome to the per project per filetype build command configuration problem :-D Exactly what I want to avoid ;-). Ditto :-) The build system solution of using the current file to select the filetype is, as you have pointed out in the past, potentially confusing, but the alternative is

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-22 Thread Lex Trotman
On 22 September 2010 21:57, Jiří Techet tec...@gmail.com wrote: On Wed, Sep 22, 2010 at 13:47, Lex Trotman ele...@gmail.com wrote: On 22 September 2010 20:47, Jiří Techet tec...@gmail.com wrote: Hi Lex, On Tue, Sep 21, 2010 at 02:41, Lex Trotman ele...@gmail.com wrote: Hi Jiri, Got it

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-22 Thread Jiří Techet
On Wed, Sep 22, 2010 at 14:06, Lex Trotman ele...@gmail.com wrote: Welcome to the per project per filetype build command configuration problem :-D Exactly what I want to avoid ;-). Ditto :-) The build system solution of using the current file to select the filetype is, as you have

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-20 Thread Lex Trotman
Hi Jiri, Got it working, I'd put the regexes in the filetypes in the wrong prefix, my mistake :-D But it doesn't seem to be working as expected. Using only the first two of your regexes the following gets: class foo {    struct bar {        int i;    };    } fair enough, the }

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-17 Thread Jiří Techet
On Fri, Sep 17, 2010 at 01:23, Lex Trotman ele...@gmail.com wrote: On 17 September 2010 06:17, Jiří Techet tec...@gmail.com wrote: On Thu, Sep 16, 2010 at 19:27, Thomas Martitz thomas.mart...@student.htw-berlin.de wrote:  On 16.09.2010 02:23, Lex Trotman wrote: Hi Jiri, I couldn't get this

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-17 Thread Lex Trotman
On 17 September 2010 18:28, Jiří Techet tec...@gmail.com wrote: On Fri, Sep 17, 2010 at 01:23, Lex Trotman ele...@gmail.com wrote: On 17 September 2010 06:17, Jiří Techet tec...@gmail.com wrote: On Thu, Sep 16, 2010 at 19:27, Thomas Martitz thomas.mart...@student.htw-berlin.de wrote:  On

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-17 Thread Lex Trotman
On 18 September 2010 02:00, Jiří Techet tec...@gmail.com wrote: On Fri, Sep 17, 2010 at 11:23, Lex Trotman ele...@gmail.com wrote: Yes, I read the instructions (rare I admit) and I copied these regexen. I'll see if I get time to look at it some more today or tomorrow. Note that unless you

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-16 Thread Jiří Techet
On Thu, Sep 16, 2010 at 19:27, Thomas Martitz thomas.mart...@student.htw-berlin.de wrote:  On 16.09.2010 02:23, Lex Trotman wrote: Hi Jiri, I couldn't get this to work at all, it printed calling indent this line all the time but didn't indent :-( I only had half an hour so I couldn't

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-16 Thread Thomas Martitz
On 16.09.2010 22:17, Jiří Techet wrote: I have just re-tested it again and it works on my machine (I have forgotten one trace in the code - that's what you see in the console). A quick question: have you read the commit log? I admit I didn't because it looked so long and I was tired :)

Re: [Geany-devel] Indentation using regex (was [PATCH 14/19] Rewrite tab switching queue)

2010-09-16 Thread Lex Trotman
On 17 September 2010 06:17, Jiří Techet tec...@gmail.com wrote: On Thu, Sep 16, 2010 at 19:27, Thomas Martitz thomas.mart...@student.htw-berlin.de wrote:  On 16.09.2010 02:23, Lex Trotman wrote: Hi Jiri, I couldn't get this to work at all, it printed calling indent this line all the time