So it's time for my forth weekly report. This is what I managed to do this week:
  • Done the trigger-key based insertion (at the moment it's Ctrl+E to insert the snippet, and the trigger-key considered is the word before the current position of the cursor -- similar to the way the Gedit Snippets insertion work). The shortcut for this will be configurable by the user.
  • Changed the file format and internal functions to make it possible for snippets to be common for more languages (considering most snippets from C will be found in C++ also). This was actually something I should have done from the start, but bad planning made me edit almost every single file, so I can add this feature.
  • Ported the macros which were used by the Macro Plugin to snippets used by my plugin.
  • Wrote some functions that will be used when making the snippets dynamic (and I actually have a plan for using them).
  • Reviewed a lot of my code until this point and changed even more :-). This means fixing some memory problems (and a very serious one which I didn't noticed until this point) or just rewriting some portions of code which were a mess.

What I will do for the next week?

     Well ... after talking to Johannes, we decided I should start working on the UI right now. That means a Snippets Browser (for which the tree model should be the snippets database - and the snippets database already implements GtkTreeModel) and a Snippets Editor which should appear attached to the browser when an arrow is pressed. A GUI prototype for what I said looks like this:


    Basically, before pushing the arrow on the Snippets Browser (first image) we have our standard Anjuta UI as it is arranged by the user. After pushing the arrow (second image), the browser will be placed on the left side with the editor attached (they actually are in the same dockable widget - which is maximized now), letting the user choose a snippet from the browser to edit. Pushing the arrow again at this point will bring up the layout which was chosen by the user (first image).
    If anyone doesn't agree with my view about this, I'm waiting for feedback :-).

    I don't think I will do all of this stuff until my next weekly report, but here are 2 goals:
  • Implement the Snippets Browser (not sure if I can provide all the features it will have in the end until next week, but at least having a view of the database should be done).
  • Try to implement the prototype above, but without the editor, just some placeholder.

How did I do compared to my plans?

    It actually was pretty okay. Last week I proposed some stuff I should do for the next 2 weeks and I did most of the stuff there (minus some bits which I will postpone until after the UI is done). 

What I have learned this week?
    
     Think a lot when planning ahead or you will be forced to rewrite about 500 lines of code just to fix your initial mess.