Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: jumafra on January 16, 2008, 11:33:50 pm
-
Hello,
I have some post-build commands that create/replace a log file which I have open on C::B editor.
After build process ends, the file isn't refreshed/reloaded, unless C::B looses and regains focus.
Would it be possible to have it reload files which are modified externally immediatly?
Regards,
Juan.
edit:
Using Rev 4820 on WinXP SP2
-
Would it be possible to have it reload files which are modified externally immediatly?
This is rather unlikely.
Becasue that would require polling all files "permanently" for modification. I guess that's not desired. Currently the modification check is bound to when the editor gets activated again. At that time it's most likely the user wold like to really modify the file. So to avoid conflicts the question is raised there at minimal (computing) cost.
-
Anyways: I guess it could be easy to implement as a plugin - something like a menu entry "refresh all open editors". A very simple (5-liner or so ;-)) C::B plugin.
-
Currently the modification check is bound to when the editor gets activated again.
Right now C::B itself has to loose focus for the file(s) to be refreshed. Wouldn't it be better to poll open files when switching editor tabs?.
-
That might work, but then we'd probably have people working on notebooks complain that the CPU fan spins up every time. Not sure.
-
Yeah, that might increase resources usage unnecessarily for most C::B users.
I guess I'll have to bear with it, and remember to force refresh. Or maybe, as Morten suggests, to implement that as a plugin... If only I knew how.
Regards
Juan
-
Like this:
[attachment deleted by admin]
-
Thanks Thomas. I'll give it a try when I have a proper wx building environment set.
Regards
Juan
-
Like this:
Did I say 5-liner? Thomas did it in a two-liner... cool stuff! ;-)
-
Actually that plugin is harmless enough to be in the source tree and nightly builds.
There's nothing in it that could possibly break something. The worst thing to happen would be some CPU cycles burnt, and if someone doesn't like it, he doesn't need to load the plugin...
-
IMO those two lines are harmless+useful enough that they shouldn't be a plugin at all and part of the core (make it possible to disable in environment/editor settings)