Code::Blocks Forums

User forums => Help => Topic started by: cichmen on June 17, 2009, 08:08:14 pm

Title: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: cichmen on June 17, 2009, 08:08:14 pm
Hi,

I have experienced odd behaviour of $ACTIVE_EDITOR_FILENAME built-in. I'm using it in post-build step.

- Open file "file1.c" in editor, do rebuild, the built-in is right = "file1.c"
- close file "file1.c", open "file2.c" in editor, do rebuild, the build-in contains still "file1.c", but should contain "file2.c"

Any advice?

Thanks,
C.
Title: Re: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: killerbot on June 17, 2009, 08:10:55 pm
thanks for the feedback, can you also file this issue in our bug tracker on our berlios page ?
So it doesn't get lost ..
Title: Re: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: Jenna on June 17, 2009, 08:23:19 pm
I just tried it with a simple test project and cannot reproduce this behaviour.

Which OS and which version of C::B do you use ?

Can you provide a simple test-project whre this behaviour occurs ?
Title: Re: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: cichmen on June 17, 2009, 08:52:17 pm
I'm using Release 8.02, on XP SP2.

Important to reproduce is the order:
1) Open only "file1.c" in editor, do rebuild
2) Close "file1.c"
3) Open only "file2.c" in editor, do rebuild

I'm not able to attach file (3kB) to this discussion, it says  "The upload folder is full. Please try a smaller file and/or contact an administrator".
Title: Re: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: killerbot on June 17, 2009, 09:07:00 pm
could you try to download the latest nightly (see nightly builds section in the forum).
Those are also very stable and up to date.
Title: Re: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: Jenna on June 17, 2009, 11:40:12 pm
I can confirm this bug, and it is fixed in trunk (r5654).

We only recalced the name of the active editor, if the pointer to the editor has changed.
Normally perfectly legal, but in some cases, if nothing else changed the calling new cbEditor(... allocated the same memory as before, so the macrosmanager was unable to detect that the editor has changed.
It now checks if the name of the file associated with the editor has changed.
Title: Re: Possible bug in $ACTIVE_EDITOR_FILENAME
Post by: cichmen on June 18, 2009, 08:09:04 pm
Thanks for fixing it!