Re: [Geany] Regex replace weirdness

2010-09-30 Thread Nick Treleaven
On Thu, 30 Sep 2010 08:53:27 +1000 Lex Trotman ele...@gmail.com wrote: Personally I think we shouldn't rematch a replaced start of line. I think this is counter intuitive. Is there a reason why the current behaviour is better? Anyway, the reason it works as it does was because that was

Re: [Geany] Regex replace weirdness

2010-09-30 Thread Lex Trotman
On 30 September 2010 21:59, Nick Treleaven nick.trelea...@btinternet.com wrote: On Thu, 30 Sep 2010 08:53:27 +1000 Lex Trotman ele...@gmail.com wrote: Personally I think we shouldn't rematch a replaced start of line. I think this is counter intuitive. Is there a reason why the current

Re: [Geany] Regex replace weirdness

2010-09-29 Thread Lex Trotman
On 29 September 2010 15:05, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Lex Trotman wrote: Perhaps, as you say, it should offer a substitute command that works line by line as well, but someone has to do it (tm) and patches are welcome (tm) (that right Frank ;-). Thats a better

Re: [Geany] Regex replace weirdness

2010-09-29 Thread Nick Treleaven
On Wed, 29 Sep 2010 16:20:33 +1000 Lex Trotman ele...@gmail.com wrote: Perhaps, as you say, it should offer a substitute command that works line by line as well, but someone has to do it (tm) and patches are welcome (tm) (that right Frank ;-). Thats a better answer than your previous

Re: [Geany] Regex replace weirdness

2010-09-29 Thread Lex Trotman
On 30 September 2010 01:32, Nick Treleaven nick.trelea...@btinternet.com wrote: On Wed, 29 Sep 2010 16:20:33 +1000 Lex Trotman ele...@gmail.com wrote: Perhaps, as you say, it should offer a substitute command that works line by line as well, but someone has to do it (tm) and patches are

Re: [Geany] Regex replace weirdness

2010-09-29 Thread Lex Trotman
On 30 September 2010 10:15, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Lex Trotman wrote: Yes I understood that, as I said the alternative is to implement the find all and replacel by proper substitute function which finds the occurrences first then substitutes them. snip I still

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Lex Trotman
On 29 September 2010 10:30, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Hi all, I've got a file of C code which for part of the file has an extra single space indent on the left hand side. To fix this I'm trying to do a regex search for ^ and replace it with (ie empty string).

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Erik de Castro Lopo
Lex Trotman wrote: On 29 September 2010 10:30, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Hi all, I've got a file of C code which for part of the file has an extra single space indent on the left hand side. To fix this I'm trying to do a regex search for ^ and replace it

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Lex Trotman
On 29 September 2010 11:09, Lex Trotman ele...@gmail.com wrote: On 29 September 2010 10:30, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Hi all, I've got a file of C code which for part of the file has an extra single space indent on the left hand side. To fix this I'm trying to do a

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Colomban Wendling
Le 29/09/2010 03:16, Lex Trotman a écrit : On 29 September 2010 11:09, Lex Trotman ele...@gmail.com wrote: On 29 September 2010 10:30, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Hi all, I've got a file of C code which for part of the file has an extra single space indent on the

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Lex Trotman
On 29 September 2010 11:24, Colomban Wendling lists@herbesfolles.org wrote: Le 29/09/2010 03:16, Lex Trotman a écrit : On 29 September 2010 11:09, Lex Trotman ele...@gmail.com wrote: On 29 September 2010 10:30, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Hi all, I've got a file

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Colomban Wendling
Le 29/09/2010 03:31, Lex Trotman a écrit : On 29 September 2010 11:24, Colomban Wendling lists@herbesfolles.org wrote: Le 29/09/2010 03:16, Lex Trotman a écrit : On 29 September 2010 11:09, Lex Trotman ele...@gmail.com wrote: On 29 September 2010 10:30, Erik de Castro Lopo

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Erik de Castro Lopo
Colomban Wendling wrote: BTW sed behaves the way Erik wants: sed 's/^ //g' file will only remove the first spaces of every lines, even though the option g is present. So does Nedit, my text editor of choice from 1995 til a month or two ago :-). Erik --

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Lex Trotman
On 29 September 2010 11:34, Colomban Wendling lists@herbesfolles.org wrote: Le 29/09/2010 03:31, Lex Trotman a écrit : On 29 September 2010 11:24, Colomban Wendling lists@herbesfolles.org wrote: Le 29/09/2010 03:16, Lex Trotman a écrit : On 29 September 2010 11:09, Lex Trotman

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Lex Trotman
On 29 September 2010 12:59, Erik de Castro Lopo mle+to...@mega-nerd.com wrote: Erik de Castro Lopo wrote: Lex Trotman wrote: So I would say that the current behavior IS correct, Except that its counter intuitive and different from the behaviour of existing text editors like Nedit and Vim

Re: [Geany] Regex replace weirdness

2010-09-28 Thread Erik de Castro Lopo
Lex Trotman wrote: Perhaps, as you say, it should offer a substitute command that works line by line as well, but someone has to do it (tm) and patches are welcome (tm) (that right Frank ;-). Thats a better answer than your previous one :-). Erik --