Author Topic: Sorting the list of abbreviations?  (Read 4949 times)

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Sorting the list of abbreviations?
« on: April 25, 2012, 11:28:53 am »
Abbreviations, as implemented in C::B, seem to me one of the most useful features I have seen in any IDE. And since they have been the thing to make me adopt C::B, I am making some *extensive* use of them.

I see, however, that when my list of defined abbreviations grows, it gets difficult to find and maintain entries because they are displayed in seemingly random order at Editor Options. They are not even in the same order they appear in default.conf, so even sorting them manually in the XML will not work.

I guess there is no way to sort the list right now, so would it be possible to request this feature for future versions? I do not know how the code does the list display, but I guess it shouldn't be too hard to sort the list before display. Any other ideas would be welcome too.
« Last Edit: April 25, 2012, 11:35:15 am by carra »

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Sorting the list of abbreviations?
« Reply #1 on: April 25, 2012, 11:49:52 am »
On a different note (but related), I have just noticed that even when I remove from the list the default abbreviations (today, wdu, now, ...), CodeBlocks just keeps re-creating them on restart every time.

I guess this should be a bug?

zabzonk

  • Guest
Re: Sorting the list of abbreviations?
« Reply #2 on: April 25, 2012, 12:05:16 pm »
I actually submitted a small patch for the sorting problem a while back http://forums.codeblocks.org/index.php/topic,15450.0.html - don't know what happened to it.

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Sorting the list of abbreviations?
« Reply #3 on: April 25, 2012, 12:19:11 pm »
Well thanks for creating the patch! I will definitely keep an eye on it. However (correct me if I'm wrong here!), looking at it, it seems that to apply it I need to compile C::B from source, which is something I don't plan on doing. But if someday I were to use the sources, I would definitely use your patch :)

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Sorting the list of abbreviations?
« Reply #4 on: April 25, 2012, 12:40:17 pm »
Being a white-on-black color scheme user, I too would appreciate it if it is applied. Can you please submit it to Berlios Neil? Maybe then somebody will take care of it.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Sorting the list of abbreviations?
« Reply #5 on: April 25, 2012, 01:08:23 pm »
I actually submitted a small patch for the sorting problem a while back http://forums.codeblocks.org/index.php/topic,15450.0.html - don't know what happened to it.
Yes - I guess its my "fault". I have applied it in my local copy for testing, but forgot to actually commit it. No need to put it in the patch tracker - I'll take care...

EDIT: Done.

Compile from trunk or wait for the next nightly.
« Last Edit: April 25, 2012, 01:11:43 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

zabzonk

  • Guest
Re: Sorting the list of abbreviations?
« Reply #6 on: April 25, 2012, 01:29:00 pm »
Quote
No need to put it in the patch tracker - I'll take care...

Thanks, Morten. I must dig out some of the other stuff I was fiddling with...


Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Sorting the list of abbreviations?
« Reply #7 on: April 25, 2012, 02:29:44 pm »
EDIT: Done.

Compile from trunk or wait for the next nightly.
Great! Thanks
At least me registering this forum was useful for something ;)


EDIT: Some opinions about C::B recreating the default abbreviations? Should that behavior be considered normal?
« Last Edit: April 25, 2012, 02:39:51 pm by carra »

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Sorting the list of abbreviations?
« Reply #8 on: April 25, 2012, 04:14:05 pm »
I also don't use most of them but that doesn't hurt anyone I guess especially when sorted. ;)

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Sorting the list of abbreviations?
« Reply #9 on: April 26, 2012, 09:21:04 am »
Yeah you may be right. I only hope that, if some day I want to use overwrite some of them (such as another use for "today") it won't get transformed back to the default.

Anyway I have noticed that not all defaults are recreated, only those corresponding to environment variables: $TODAY, $TODAY_UTC, etc. Other defaults such as "if", "while" or "guard", do NOT get recreated.