Revision: 509
Author: eht16
Date: 2006-06-30 05:56:09 -0700 (Fri, 30 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=509&view=rev
Log Message:
-----------
Finally fixed the second call of the switch_page callback.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/callbacks.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-29 23:51:32 UTC (rev 508)
+++ trunk/ChangeLog 2006-06-30 12:56:09 UTC (rev 509)
@@ -4,6 +4,8 @@
Change the path in the VTE widget when switching between files
according to the path of the current file.
Process the switch_page callback only once.
+ * src/callbacks.c: Finally fixed the second call of the switch_page
+ callback.
2006-06-29 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2006-06-29 23:51:32 UTC (rev 508)
+++ trunk/src/callbacks.c 2006-06-30 12:56:09 UTC (rev 509)
@@ -709,14 +709,7 @@
gpointer user_data)
{
gint idx;
- static gboolean state = FALSE;
- // this function is called two times when switching notebook pages, I really don't know why
- // so, skip one call (workaround)
- state= ! state;
- if (state) return;
-
-
if (closing_all) return;
// guint == -1 seems useless, but it isn't!
@@ -758,13 +751,7 @@
gpointer user_data)
{
gint idx;
- static gboolean state = FALSE;
- // this function is called two times when switching notebook pages, I really don't know why
- // so, skip one call (workaround)
- state= ! state;
- if (state) return;
-
if (closing_all) return;
// guint == -1 seems useless, but it isn't!
@@ -1156,7 +1143,8 @@
GtkTreeModel *model;
gint idx = 0;
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ // use switch_notebook_page to ignore changing the notebook page because it is already done
+ if (gtk_tree_selection_get_selected(selection, &model, &iter) && ! switch_notebook_page)
{
gtk_tree_model_get(model, &iter, 1, &idx, -1);
gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 507
Author: eht16
Date: 2006-06-29 12:08:21 -0700 (Thu, 29 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=507&view=rev
Log Message:
-----------
Create a new tm_source_file object if a file is renamed, otherwise tagmanager won't work correctly.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/callbacks.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-29 18:22:11 UTC (rev 506)
+++ trunk/ChangeLog 2006-06-29 19:08:21 UTC (rev 507)
@@ -20,6 +20,9 @@
* src/utils.c: Added function is_opening_brace().
* src/sci_cb.c:
Use is_opening_brace() for better handling of calltips.
+ * src/callbacks.c:
+ Create a new tm_source_file object if a file is renamed, otherwise
+ tagmanager won't work correctly.
2006-06-28 Enrico Tröger <enrico.troeger(a)uvena.de>
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2006-06-29 18:22:11 UTC (rev 506)
+++ trunk/src/callbacks.c 2006-06-29 19:08:21 UTC (rev 507)
@@ -892,7 +892,12 @@
}
gtk_widget_hide(app->save_filesel);
- if (doc_list[idx].file_name) g_free(doc_list[idx].file_name);
+ if (doc_list[idx].file_name)
+ { // create a new tm_source_file object otherwise tagmanager won't work correctly
+ tm_workspace_remove_object(doc_list[idx].tm_file, TRUE);
+ doc_list[idx].tm_file = NULL;
+ g_free(doc_list[idx].file_name);
+ }
doc_list[idx].file_name = new_filename;
utils_replace_filename(idx);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 506
Author: eht16
Date: 2006-06-29 11:22:11 -0700 (Thu, 29 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=506&view=rev
Log Message:
-----------
Added function is_opening_brace().
Use is_opening_brace() for better handling of calltips.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/sci_cb.c
trunk/src/utils.c
trunk/src/utils.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-29 17:14:52 UTC (rev 505)
+++ trunk/ChangeLog 2006-06-29 18:22:11 UTC (rev 506)
@@ -17,6 +17,9 @@
src/utils.c, src/prefs.c, geany.glade, src/interface.c,
src/keybindings.c, src/document.c:
Implemented simple printing support.
+ * src/utils.c: Added function is_opening_brace().
+ * src/sci_cb.c:
+ Use is_opening_brace() for better handling of calltips.
2006-06-28 Enrico Tröger <enrico.troeger(a)uvena.de>
Modified: trunk/src/sci_cb.c
===================================================================
--- trunk/src/sci_cb.c 2006-06-29 17:14:52 UTC (rev 505)
+++ trunk/src/sci_cb.c 2006-06-29 18:22:11 UTC (rev 506)
@@ -356,18 +356,26 @@
const GPtrArray *tags;
if (sci == NULL) return FALSE;
-
+
lexer = SSM(sci, SCI_GETLEXER, 0, 0);
idx = document_find_by_sci(sci);
if (idx == -1 || ! doc_list[idx].is_valid || doc_list[idx].file_type == NULL) return FALSE;
-
+
word[0] = '\0';
if (pos == -1)
- { // position of '(' is unknown, so go backwards to find it
+ {
+ gchar c;
+ // position of '(' is unknown, so go backwards to find it
pos = SSM(sci, SCI_GETCURRENTPOS, 0, 0);
- // I'm not sure if utils_isbrace() is a good idea, but it is the simplest way, but we need
- // something more intelligent than only check for '(' because e.g. LaTeX uses {, [ or (
- while (pos >= 0 && ! utils_isbrace(SSM(sci, SCI_GETCHARAT, pos, 0))) pos--;
+ // I'm not sure if utils_is_opening_brace() is a good idea, but it is the simplest way,
+ // but we need something more intelligent than only check for '(' because e.g. LaTeX
+ // uses {, [ or (
+ c = SSM(sci, SCI_GETCHARAT, pos, 0);
+ while (pos > 0 && ! utils_is_opening_brace(c) && c != ';')
+ {
+ c = SSM(sci, SCI_GETCHARAT, pos, 0);
+ pos--;
+ }
}
style = SSM(sci, SCI_GETSTYLEAT, pos, 0);
@@ -680,7 +688,7 @@
GString *words;
if (sci == NULL) return;
-
+
ftags = g_ptr_array_sized_new(50);
words = g_string_sized_new(200);
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2006-06-29 17:14:52 UTC (rev 505)
+++ trunk/src/utils.c 2006-06-29 18:22:11 UTC (rev 506)
@@ -335,7 +335,7 @@
switch (c)
{
case '<':
- case '>': return TRUE;
+ case '>': return TRUE;
}
}
@@ -346,15 +346,37 @@
case '{':
case '}':
case '[':
- case ']': return TRUE;
- default: return FALSE;
+ case ']': return TRUE;
+ default: return FALSE;
}
return FALSE;
}
+gboolean utils_is_opening_brace(gchar c)
+{
+ // match < only if desired, because I don't like it, but some people do
+ if (app->brace_match_ltgt)
+ {
+ switch (c)
+ {
+ case '<': return TRUE;
+ }
+ }
+ switch (c)
+ {
+ case '(':
+ case '{':
+ case '[': return TRUE;
+ default: return FALSE;
+ }
+
+ return FALSE;
+}
+
+
void utils_set_editor_font(const gchar *font_name)
{
gint i, size;
Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h 2006-06-29 17:14:52 UTC (rev 505)
+++ trunk/src/utils.h 2006-06-29 18:22:11 UTC (rev 506)
@@ -54,6 +54,8 @@
gboolean utils_isbrace(gchar c);
+gboolean utils_is_opening_brace(gchar c);
+
/* This sets the window title according to the current filename. */
void utils_set_window_title(gint index);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.