Hi there
On looking at the sci_wrappers.c and having implemented the plugin sci stuff i think most people would be like me and want all of the sci wrapper functions available in the plugin api, more or less.
Is there a reason to not just add all of them in one go rather than piecemeal? If not, I'll do a little script to strip them out into the correct format.
Comments?
thanks
bd
On 7/30/07, blackdog blackdog@ipowerhouse.com wrote:
On looking at the sci_wrappers.c and having implemented the plugin sci stuff i think most people would be like me and want all of the sci wrapper functions available in the plugin api, more or less.
Comments?
For my 2c, that sounds great!
- Jeff
On 07/31/2007 12:23:34 AM, blackdog wrote:
On looking at the sci_wrappers.c and having implemented the plugin sci stuff i think most people would be like me and want all of the sci wrapper functions available in the plugin api, more or less.
Is there a reason to not just add all of them in one go rather than piecemeal? If not, I'll do a little script to strip them out into the correct format.
Comments?
Well, I think most of sciwrappers are not common functions - to take the first 3: sci_set_line_numbers, sci_set_mark_long_lines, sci_get_line_numbers
I don't think plugins should use these. I think in the rare circumstance a plugin needs to use an unusual scintilla message, it can do that with scintilla_send_message() or by copying the wrapper from sciwrappers.c and making it static.
Of course, if you want to add a block of commonly used scintilla functions, go ahead ;-)
Regards, Nick
On 7/31/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
Well, I think most of sciwrappers are not common functions - to take the first 3: sci_set_line_numbers, sci_set_mark_long_lines, sci_get_line_numbers
I don't think plugins should use these.
Yes, the preferences and display-related stuff probably aren't very useful, at least not for me.
For now, I would mainly like to manipulate things like the caret position and selection start/end.
- Jeff
agreed, only where it makes sense, but of course what makes sense to me may not make sense to you :) and vice versa. I think that's the devil in the detail with this, you never know how folks may want to use it.
bd
On Tue, 31 Jul 2007 06:41:06 -0500 "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
On 7/31/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
Well, I think most of sciwrappers are not common functions - to take the first 3: sci_set_line_numbers, sci_set_mark_long_lines, sci_get_line_numbers
I don't think plugins should use these.
Yes, the preferences and display-related stuff probably aren't very useful, at least not for me.
For now, I would mainly like to manipulate things like the caret position and selection start/end.
- Jeff
Geany mailing list Geany@uvena.de http://uvena.de/cgi-bin/mailman/listinfo/geany
On 7/31/07, blackdog blackdog@ipowerhouse.com wrote:
agreed, only where it makes sense, but of course what makes sense to me may not make sense to you :) and vice versa. I think that's the devil in the detail with this, you never know how folks may want to use it.
How does this look for starters:
sci_end_undo_action sci_start_undo_action sci_get_col_from_position sci_get_line_from_position sci_get_position_from_line sci_set_current_position sci_get_selection_start sci_get_selection_end sci_get_selection_mode sci_set_selection_mode sci_set_selection_start sci_set_selection_end sci_get_line sci_get_line_length sci_get_line_count sci_get_line_is_visible sci_ensure_line_is_visible sci_get_tab_width sci_scroll_caret sci_get_text_range sci_get_readonly sci_find_bracematch
If nobody objects, I will work on a patch to add these. (unless someone else beats me to it :-)
- Jeff
hi Jeff
I was working on it, by doing some code which generated all the methods from the sciwrappers, I stopped because I'm sure somwhere there's an assignment of sci function to plugin function but I can't find it anywhere, if you can tell me where that is, I can save you some work :) in fact I attach the files I already have if you want to work with them in the meantime, they're snippets to manually include in the correct places.
bd
On Tue, 31 Jul 2007 22:47:26 -0500 "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
On 7/31/07, blackdog blackdog@ipowerhouse.com wrote:
agreed, only where it makes sense, but of course what makes sense to me may not make sense to you :) and vice versa. I think that's the devil in the detail with this, you never know how folks may want to use it.
How does this look for starters:
sci_end_undo_action sci_start_undo_action sci_get_col_from_position sci_get_line_from_position sci_get_position_from_line sci_set_current_position sci_get_selection_start sci_get_selection_end sci_get_selection_mode sci_set_selection_mode sci_set_selection_start sci_set_selection_end sci_get_line sci_get_line_length sci_get_line_count sci_get_line_is_visible sci_ensure_line_is_visible sci_get_tab_width sci_scroll_caret sci_get_text_range sci_get_readonly sci_find_bracematch
If nobody objects, I will work on a patch to add these. (unless someone else beats me to it :-)
- Jeff
Geany mailing list Geany@uvena.de http://uvena.de/cgi-bin/mailman/listinfo/geany
On 08/01/2007 04:47:26 AM, Jeff Pohlmeyer wrote:
On 7/31/07, blackdog blackdog@ipowerhouse.com wrote:
agreed, only where it makes sense, but of course what makes sense
to me
may not make sense to you :) and vice versa. I think that's the
devil
in the detail with this, you never know how folks may want to use
it.
How does this look for starters:
sci_end_undo_action [...] sci_find_bracematch
If nobody objects, I will work on a patch to add these. (unless someone else beats me to it :-)
These look fine. I'll add a scintilla_send_message() pointer to the API so any uncommon messages can still be sent or wrapped locally by the plugin.
Regards, Nick
On 8/2/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
How does this look for starters:
sci_end_undo_action [...] sci_find_bracematch
These look fine. I'll add a scintilla_send_message() pointer to the API so any uncommon messages can still be sent or wrapped locally by the plugin.
OK, here is a patch that adds the functions I listed.
BTW, the struct sci_funcs is starting to look to me like it might be an easy place for a bug to slip in if one of the initializers somehow gets out of order - I wonder if it might be a good idea to use explicit (named) initializers here, like:
static ScintillaFuncs sci_funcs = { set_text: &sci_set_text, ... find_bracematch: &sci_find_bracematch };
- Jeff
P.S. Again, I didn't bump the API version, but I guess you can do that when you do the scintilla_send_message() thing.
On 08/03/2007 12:18:28 AM, Jeff Pohlmeyer wrote:
On 8/2/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
How does this look for starters:
sci_end_undo_action [...] sci_find_bracematch
These look fine. I'll add a scintilla_send_message() pointer to the
API
so any uncommon messages can still be sent or wrapped locally by
the
plugin.
Now added. I also added filetypes, editor_info, sci_cmd() and lookup_widget().
OK, here is a patch that adds the functions I listed.
Thanks, applied in SVN.
BTW, the struct sci_funcs is starting to look to me like it might be an easy place for a bug to slip in if one of the initializers somehow gets out of order - I wonder if it might be a good idea to use explicit (named) initializers here, like:
static ScintillaFuncs sci_funcs = { set_text: &sci_set_text, ... find_bracematch: &sci_find_bracematch };
Is that standard C? I think we need to support C89 (in the past, we've received patches to support gcc 2.x).
- &sci_get_tab_width,
I removed this because you can now use geany_data->editor_prefs-
tab_width.
- &sci_get_readonly,
I removed this because you can use document::readonly.
Regards, Nick
On 8/3/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
I'll add a scintilla_send_message() pointer to the API
Now added. I also added filetypes, editor_info, sci_cmd() and lookup_widget().
Cool.
OK, here is a patch that adds the functions I listed.
Thanks, applied in SVN.
Thank you!
use explicit (named) initializers...
Is that standard C?
Good catch - trying a simple program using that style, compiling with `gcc -pedantic' says: # warning: obsolete use of designated initializer with ':'
I also tried the alternate syntax: struct foo {.bar=baz} and compiling with `gcc -pedantic' says: # warning: ISO C90 forbids specifying subobject to initialize
So I guess there's just not a portable way to do it.
&sci_get_tab_width,
you can now use geany_data->editor_prefs->tab_width.
&sci_get_readonly,
you can use document::readonly.
Sounds good to me...
Thanks, - Jeff