On Windows-XP, toggling the comments with Ctrl-E fails to toggle lines which follows an empty line. On Ubuntu Karmic (PPA release of Geany) this works as expected.
Hi Joerg,
On Tue, 21 Sep 2010 08:32:50 +0200 Joerg Desch jd.vvd@web.de wrote:
On Windows-XP, toggling the comments with Ctrl-E fails to toggle lines which follows an empty line. On Ubuntu Karmic (PPA release of Geany) this works as expected.
Which you are using at Windows?
Cheers, Frank
Hi Frank,
On Tue, 21 Sep 2010 12:56:48 +0200 Frank Lanitz frank@frank.uvena.de wrote:
Which you are using at Windows?
Release 0.19.1 from greany.org. Downloaded yesterday. ;-)
On Tue, 21 Sep 2010 08:32:50 +0200 Joerg Desch jd.vvd@web.de wrote:
On Windows-XP, toggling the comments with Ctrl-E fails to toggle lines which follows an empty line. On Ubuntu Karmic (PPA release of Geany) this works as expected.
Seems to work here OK. What are your comment settings, filetype, etc?
Regards, Nick
On Wed, 22 Sep 2010 18:00:41 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Tue, 21 Sep 2010 08:32:50 +0200 Joerg Desch jd.vvd@web.de wrote:
On Windows-XP, toggling the comments with Ctrl-E fails to toggle lines which follows an empty line. On Ubuntu Karmic (PPA release of Geany) this works as expected.
Seems to work here OK. What are your comment settings, filetype, etc?
I'm using a simple C file. All settings are unchanged. Previously, V 0.19 was installed.
I've renamed the geany configuration directory and started geany with it's defaults. The same problem.
On Thu, 23 Sep 2010 07:14:20 +0200 Joerg Desch jd.vvd@web.de wrote:
On Windows-XP, toggling the comments with Ctrl-E fails to toggle lines which follows an empty line. On Ubuntu Karmic (PPA release of Geany) this works as expected.
Seems to work here OK. What are your comment settings, filetype, etc?
I'm using a simple C file. All settings are unchanged. Previously, V 0.19 was installed.
I've renamed the geany configuration directory and started geany with it's defaults. The same problem.
I still can't reproduce this with a clean config. Can you give a code example of what doesn't work?
Regards, Nick
Hi Nick,
On Thu, 23 Sep 2010 13:43:41 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
I still can't reproduce this with a clean config. Can you give a code example of what doesn't work?
Today, I've installed a fresh Geany (with GTK) onto a Vista notebook. After the installation, I've started Geany, created a new C-Source and typed a "foo" function. Than I marked the content of the scope of the function end pressed Ctrl-E. This is the result:
void foo (void) { //~ int i; for (i = 0; i <3; i++) //~ { //~ printf("%d\n",i); //~ } }
As you can see, the "for (" isn't commented out. If I remove the empty line, all works as expected.
On Fri, 24 Sep 2010 10:59:26 +0200 Joerg Desch jd.vvd@web.de wrote:
I still can't reproduce this with a clean config. Can you give a code example of what doesn't work?
Today, I've installed a fresh Geany (with GTK) onto a Vista notebook. After the installation, I've started Geany, created a new C-Source and typed a "foo" function. Than I marked the content of the scope of the function end pressed Ctrl-E. This is the result:
void foo (void) { //~ int i;
for (i = 0; i <3; i++) //~ { //~ printf("%d\n",i); //~ } }
As you can see, the "for (" isn't commented out. If I remove the empty line, all works as expected.
OK, I can reproduce this when using Windows line endings. I didn't think of that before ;-)
I can't find an easy fix though, the code is quite hard to follow.
Regards, Nick
On Fri, 24 Sep 2010 13:10:24 +0100, Nick wrote:
On Fri, 24 Sep 2010 10:59:26 +0200 Joerg Desch jd.vvd@web.de wrote:
I still can't reproduce this with a clean config. Can you give a code example of what doesn't work?
Today, I've installed a fresh Geany (with GTK) onto a Vista notebook. After the installation, I've started Geany, created a new C-Source and typed a "foo" function. Than I marked the content of the scope of the function end pressed Ctrl-E. This is the result:
void foo (void) { //~ int i;
for (i = 0; i <3; i++) //~ { //~ printf("%d\n",i); //~ } }
As you can see, the "for (" isn't commented out. If I remove the empty line, all works as expected.
OK, I can reproduce this when using Windows line endings. I didn't think of that before ;-)
I can't find an easy fix though, the code is quite hard to follow.
I must agree :(.
Anyway, the fix seems to be quite easy: we read the lines to be commented/uncommented and remove the last character ('\n' usually) but we didn't care about CRLF. So the '\r' kept in the buffer holding the line and that confused the other code. I changed the code so it removes as many characters as the end of line characters of the document take (i.e. 1 or 2). This seems to work, I hope this won't break anything else.
Regards, Enrico
On Sun, 26 Sep 2010 20:05:23 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, the fix seems to be quite easy: we read the lines to be commented/uncommented and remove the last character ('\n' usually) but we didn't care about CRLF. So the '\r' kept in the buffer holding the line and that confused the other code.
Do you mean that you change the document? Or do you change the "internal representation", so that the file on disk isn't changed?
What I want to ask is, does the file after storing has still CRLF line endings?
This seems to work, I hope this won't break anything else.
Sounds good. ;-)
On Mon, 27 Sep 2010 08:48:45 +0200 Joerg Desch jd.vvd@web.de wrote:
On Sun, 26 Sep 2010 20:05:23 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, the fix seems to be quite easy: we read the lines to be commented/uncommented and remove the last character ('\n' usually) but we didn't care about CRLF. So the '\r' kept in the buffer holding the line and that confused the other code.
Do you mean that you change the document? Or do you change the "internal representation", so that the file on disk isn't changed?
What I want to ask is, does the file after storing has still CRLF line endings?
I just tried it with an testdocument to doublecheck and be sure, but the line endings keeps as they are.
Cheers, Frank
On Mon, 27 Sep 2010 08:48:45 +0200, Joerg wrote:
On Sun, 26 Sep 2010 20:05:23 +0200 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, the fix seems to be quite easy: we read the lines to be commented/uncommented and remove the last character ('\n' usually) but we didn't care about CRLF. So the '\r' kept in the buffer holding the line and that confused the other code.
Do you mean that you change the document? Or do you change the "internal representation", so that the file on disk isn't changed?
Er, sorry for not being clear. The change I did was only internal in Geany. When we toggle line commentation, each line is read into a new buffer and analysed before performing any changes. And for this internal buffer, I made the changes. So the file itself is not touched at all.
What I want to ask is, does the file after storing has still CRLF line endings?
Sure.
Regards, Enrico