Revision: 4038 http://geany.svn.sourceforge.net/geany/?rev=4038&view=rev Author: ntrel Date: 2009-07-28 14:29:34 +0000 (Tue, 28 Jul 2009)
Log Message: ----------- Fix reshowing calltip in the wrong document.
Modified Paths: -------------- trunk/ChangeLog trunk/src/editor.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-07-28 12:13:45 UTC (rev 4037) +++ trunk/ChangeLog 2009-07-28 14:29:34 UTC (rev 4038) @@ -5,6 +5,8 @@ src/Makefile.am, ChangeLog, wscript: Move plugin_* utility functions to pluginutils.c. Add pluginprivate.h. + * src/editor.c: + Fix reshowing calltip in the wrong document.
2009-07-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2009-07-28 12:13:45 UTC (rev 4037) +++ trunk/src/editor.c 2009-07-28 14:29:34 UTC (rev 4038) @@ -500,24 +500,30 @@ static gboolean reshow_calltip(gpointer data) { CalltipReshowInfo *cri = data; + GeanyDocument *doc;
g_return_val_if_fail(calltip.sci != NULL, FALSE);
SSM(calltip.sci, SCI_CALLTIPCANCEL, 0, 0); - /* we use the position where the calltip was previously started as SCI_GETCURRENTPOS - * may be completely wrong in case the user cancelled the auto completion with the mouse */ - SSM(calltip.sci, SCI_CALLTIPSHOW, calltip.pos, (sptr_t) calltip.text); + doc = document_get_current();
- /* now autocompletion has been cancelled by SCI_CALLTIPSHOW, so do it manually */ - if (cri->message == SCN_AUTOCSELECTION) + if (doc && doc->editor->sci == calltip.sci) { - gint pos = SSM(calltip.sci, SCI_GETCURRENTPOS, 0, 0); + /* we use the position where the calltip was previously started as SCI_GETCURRENTPOS + * may be completely wrong in case the user cancelled the auto completion with the mouse */ + SSM(calltip.sci, SCI_CALLTIPSHOW, calltip.pos, (sptr_t) calltip.text);
- sci_set_selection_start(calltip.sci, cri->pos); - sci_set_selection_end(calltip.sci, pos); - sci_replace_sel(calltip.sci, ""); /* clear root of word */ - SSM(calltip.sci, SCI_INSERTTEXT, cri->pos, (sptr_t) cri->text); - sci_goto_pos(calltip.sci, cri->pos + strlen(cri->text), FALSE); + /* now autocompletion has been cancelled by SCI_CALLTIPSHOW, so do it manually */ + if (cri->message == SCN_AUTOCSELECTION) + { + gint pos = SSM(calltip.sci, SCI_GETCURRENTPOS, 0, 0); + + sci_set_selection_start(calltip.sci, cri->pos); + sci_set_selection_end(calltip.sci, pos); + sci_replace_sel(calltip.sci, ""); /* clear root of word */ + SSM(calltip.sci, SCI_INSERTTEXT, cri->pos, (sptr_t) cri->text); + sci_goto_pos(calltip.sci, cri->pos + strlen(cri->text), FALSE); + } } g_free(cri->text); g_free(cri);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.