There is a problem as I understand it with checking for the SC_MARK_AVAILABLE marker to see if a marker is available...<br>
<br>
Markers seem by default to be set to 0 (SC_MARK_CIRCLE) by scintilla. So there is no way to tell if a marker is being used with the default marker icon (SC_MARK_CIRCLE), or is not being used. The following code dropped in anywhere that it will get run (I placed it in the DefineMarkers function of geanynummberedbookmarks) will demonstrate:<br>

<br>
GtkWidget *dialog;<br>
gchar temp[10000];<br>
gint m[32];<br>
for(i=0;i<32;i++)<br>
m[i]=scintilla_send_message(sci,SCI_MARKERSYMBOLDEFINED,i,0);<br>
sprintf(temp,"%d %d %d %d %d %d %d %d\n%d %d %d %d %d %d %d %d\n%d %d %d %d<br>
%d %d %d %d\n%d %d %d %d %d %d %d<br>
%d",m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15],m[16],m[17],m[18],m[19],m[20],m[21],m[22],m[23],m[24],m[25],m[26],m[27],m[28],m[29],m[30],m[31]);<br>
dialog=gtk_message_dialog_new(GTK_WINDOW(geany->main_widgets->window),<br>
                        GTK_DIALOG_DESTROY_WITH_PARENT,<br>
                        GTK_MESSAGE_ERROR,<br>
                        GTK_BUTTONS_NONE,<br>
                        "%s",temp);<br>
gtk_dialog_add_button(GTK_DIALOG(dialog),_("_Okay"),GTK_RESPONSE_OK);<br>
gtk_dialog_run(GTK_DIALOG(dialog));<br>
gtk_widget_destroy(dialog);<br>g_free(temp);<br>
<br>
This displays the value of each marker, and those that aren't being used for anything are showing up as 0, and not 28 (SC_MARK_AVAILABLE).<br><br>
I can see 4 options, and I'd like to see what people think about them, or if they can think of any better solutions:<br>
1) agree between plugin developers which markers they will use and use them staticly (as we are now, but ensuring they don't overlap)<br>
2) change scintilla or geany so that markers are set to SC_MARK_AVAILABLE when it is initialised.<br>
3) Have a plugin that is run before any others or some static code usable by all plugins that sets all editor unused markers to SC_MARK_AVAILABLE ready for the other plugins.<br>
4) Have an option in the preferences for each plugin that uses markers to allow users to define which markers are to be used by that plugin.<br>
<br>
There are pros & cons to each of these:<br><br>With option 1 we will probably run out of markers for anyone wanting to develop a new plugin. Also would have to change code if editor's use of markers changed. It is easiest to implement here and now.<br>
<br>Option 2 would be the most versatile in the long run, but would require altering someone else's project purely for our own devices, and it would require anyone using a plugin using markers to have to use the latest version of geany.<br>
<br>Option 3 would mean we could handle marker allocation in-house, but would require an extra plugin, and can we ensure that it would be loaded before any other plugin? Or would we agree that any plugin using markers would have to access a shared piece of code that's keeping track of which markers are being used to see what's available?<br>
<br>
Option 4 would be simple for us to implement, but would be messy, and complicated for the user (like having to set IRQ numbers in the old day to get your PC to work).<br>
<br>
My personal preference would be some shared static function that any plugin using markers could access.<br>
<br>
Looking forward to your opinions.<br>
<br>
William Fraser<br>