Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: k1mgy on November 23, 2005, 03:50:17 am
-
The Source Code Formatter plugin (hope this is the right place for this) does not provide a progress dialog.
Therefore, with large sources that take 15 seconds or so to complete, the wait can be unnerving. Did it break? Is it done?
I don't know. When it finishes the cursor position is moved to the bottom of the viewport - that's the only way to tell.
I think it would be nice if this plugin provided a progress dialog (percentage, or line by line) and when it finishes, puts the cursor back to the same position and with the viewport aligned as it was.
-
That one is kinda hard.
The plugin is using an external "library", which is AStyle. The plugin as it just takes all the text from the editor and sends it to AStyle. When AStyle is done it returns the formatted text. Now the plugin just replaces the text in the editor with the formatted one.
What I'm curious about is how long is that source file to make the plugin take 15 seconds to complete?
The only way I'm seeing to do that without modifying AStyle is to "fool" it with a really special kind of istream.
BTW, could you provide a sample source file that take long enough for testing purposes?
-
I can't provide the source as most of it is proprietary. Sorry. But there is one possibility: I was tired, it was late, and I was wrong :)
I timed it, and the process takes 7 seconds to complete. The file is 5226 lines long and is 150k in size.
Still, seems like a long time with no hourglass.
Can you set the hourglass?
-
That one would be more viable :)
Ok, I've just tested it and was quite simple: 1 line :)
I'll commit it later if no one complains about... so... ppl... it's your turn to complain :)
-
Installed your binary (thanks for providing these) but no hourglass.
CodeBlocksCVS20051121.7z 21-Nov-2005 17:24 3.1M
-
Seems like other things will need hourglass also.
-
Installed your binary (thanks for providing these) but no hourglass.
Oops! I totally forgot to add it to CVS :P
I'll try to get it ready for tomorrow, and maybe release another snapshot.