Revision: 1151
http://svn.sourceforge.net/geany/?rev=1151&view=rev
Author: eht16
Date: 2006-12-31 07:47:37 -0800 (Sun, 31 Dec 2006)
Log Message:
-----------
When opening a file, set the current selected entry in the open files list to the file's filename.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/treeviews.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-12-30 16:18:15 UTC (rev 1150)
+++ trunk/ChangeLog 2006-12-31 15:47:37 UTC (rev 1151)
@@ -1,3 +1,9 @@
+2006-12-31 Enrico Tröger <enrico.troeger(a)uvena.de>
+
+ * src/treeviews.c: When opening a file, set the current selected
+ entry in the open files list to the file's filename.
+
+
2006-12-30 Nick Treleaven <nick.treleaven(a)btinternet.com>
* src/ui_utils.c:
Modified: trunk/src/treeviews.c
===================================================================
--- trunk/src/treeviews.c 2006-12-30 16:18:15 UTC (rev 1150)
+++ trunk/src/treeviews.c 2006-12-31 15:47:37 UTC (rev 1151)
@@ -332,6 +332,10 @@
gtk_list_store_append(tv.store_openfiles, iter);
treeviews_openfiles_update(idx);
+
+ // select opened file
+ GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tv.tree_openfiles));
+ gtk_tree_selection_select_iter(sel, iter);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1150
http://svn.sourceforge.net/geany/?rev=1150&view=rev
Author: ntrel
Date: 2006-12-30 08:18:15 -0800 (Sat, 30 Dec 2006)
Log Message:
-----------
Update
Modified Paths:
--------------
trunk/THANKS
Modified: trunk/THANKS
===================================================================
--- trunk/THANKS 2006-12-30 16:16:59 UTC (rev 1149)
+++ trunk/THANKS 2006-12-30 16:18:15 UTC (rev 1150)
@@ -20,6 +20,7 @@
Stefan Oltmanns <stefan(dot)oltmanns(at)abi2006(dot)gymnasium-achim(dot)de> - escape sequences patch
Bob Doan <bdoan(at)sicom(dot)com> - some patches
Rob van der Linde <robvdl(at)paradise(dot)net(dot)nz> - fixed wrong vte height on some systems
+Josef Whiter <josef(at)toxicpanda(dot)com> - parse 'Entering directory' build messages.
Translators:
----------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1148
http://svn.sourceforge.net/geany/?rev=1148&view=rev
Author: ntrel
Date: 2006-12-30 03:49:47 -0800 (Sat, 30 Dec 2006)
Log Message:
-----------
Don't use gtk_rc_get_style() in ui_update_tab_status() because it
can cause an invalid memory read on some systems.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/ui_utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-12-26 15:49:35 UTC (rev 1147)
+++ trunk/ChangeLog 2006-12-30 11:49:47 UTC (rev 1148)
@@ -1,3 +1,10 @@
+2006-12-30 Nick Treleaven <nick.treleaven(a)btinternet.com>
+
+ * src/ui_utils.c:
+ Don't use gtk_rc_get_style() in ui_update_tab_status() because it
+ can cause an invalid memory read on some systems.
+
+
2006-12-26 Nick Treleaven <nick.treleaven(a)btinternet.com>
* tagmanager/tm_tag.c, tagmanager/include/tm_tag.h:
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2006-12-26 15:49:35 UTC (rev 1147)
+++ trunk/src/ui_utils.c 2006-12-30 11:49:47 UTC (rev 1148)
@@ -1179,16 +1179,11 @@
void ui_update_tab_status(gint idx)
{
GdkColor *color = document_get_status(idx);
- static GtkStyle *style = NULL;
- if (style == NULL) // use and store default foreground colour
- style = gtk_rc_get_style(doc_list[idx].tab_label);
+ // NULL color will reset to default
+ gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL, color);
+ gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE, color);
- gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_NORMAL,
- color ? color : &(style->fg[GTK_STATE_NORMAL]));
- gtk_widget_modify_fg(doc_list[idx].tab_label, GTK_STATE_ACTIVE,
- color ? color : &(style->fg[GTK_STATE_ACTIVE]));
-
treeviews_openfiles_update(idx);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1145
http://svn.sourceforge.net/geany/?rev=1145&view=rev
Author: ntrel
Date: 2006-12-24 04:32:52 -0800 (Sun, 24 Dec 2006)
Log Message:
-----------
Improve accuracy of sci_scroll_to_line() when line wrapping and/or
folding is used.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/sciwrappers.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-12-24 12:07:35 UTC (rev 1144)
+++ trunk/ChangeLog 2006-12-24 12:32:52 UTC (rev 1145)
@@ -3,6 +3,9 @@
* src/utils.c, src/sci_cb.c:
Only call SCI_BRACEMATCH once in sci_cb_highlight_braces().
Separate find_calltip() from sci_cb_show_calltip().
+ * src/sciwrappers.c:
+ Improve accuracy of sci_scroll_to_line() when line wrapping and/or
+ folding is used.
2006-12-22 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/sciwrappers.c
===================================================================
--- trunk/src/sciwrappers.c 2006-12-24 12:07:35 UTC (rev 1144)
+++ trunk/src/sciwrappers.c 2006-12-24 12:32:52 UTC (rev 1145)
@@ -678,17 +678,19 @@
{
gint vis1, los, delta;
- if (GTK_WIDGET(sci)->allocation.height <= 1) return; // prevent gdk_window_scroll warning
+ if (GTK_WIDGET(sci)->allocation.height <= 1) return; // try to prevent gdk_window_scroll warning
if (line == -1)
line = sci_get_current_line(sci, -1);
- // sci 'visible line' != file line number
+ // sci 'visible line' != doc line number because of folding and line wrapping
+ /* calling SCI_VISIBLEFROMDOCLINE for line is more accurate than calling
+ * SCI_DOCLINEFROMVISIBLE for vis1. */
+ line = SSM(sci, SCI_VISIBLEFROMDOCLINE, line, 0);
vis1 = SSM(sci, SCI_GETFIRSTVISIBLELINE, 0, 0);
- vis1 = SSM(sci, SCI_DOCLINEFROMVISIBLE, vis1, 0);
los = SSM(sci, SCI_LINESONSCREEN, 0, 0);
delta = (line - vis1) - los * percent_of_view;
sci_scroll_lines(sci, delta);
- sci_scroll_caret(sci); //ensure visible, in case of excessive folding/wrapping
+ sci_scroll_caret(sci); // ensure visible (maybe not needed now)
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1143
http://svn.sourceforge.net/geany/?rev=1143&view=rev
Author: ntrel
Date: 2006-12-22 07:59:01 -0800 (Fri, 22 Dec 2006)
Log Message:
-----------
Don't reparse the current function when fold level is higher than
the function fold level (when the line has only changed by 1).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-12-21 22:21:09 UTC (rev 1142)
+++ trunk/ChangeLog 2006-12-22 15:59:01 UTC (rev 1143)
@@ -1,3 +1,10 @@
+2006-12-22 Nick Treleaven <nick.treleaven(a)btinternet.com>
+
+ * src/utils.c:
+ Don't reparse the current function when fold level is higher than
+ the function fold level (when the line has only changed by 1).
+
+
2006-12-21 Enrico Tröger <enrico.troeger(a)uvena.de>
* doc/geany.1.in, doc/Makefile.am, doc/geany.docbook, doc/images/*,
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2006-12-21 22:21:09 UTC (rev 1142)
+++ trunk/src/utils.c 2006-12-22 15:59:01 UTC (rev 1143)
@@ -371,12 +371,24 @@
}
+/* This could perhaps be improved to check for #if, class etc. */
+static gint get_function_fold_number(gint idx)
+{
+ // for Java the functions are always one fold level above the class scope
+ if (FILETYPE_ID(doc_list[idx].file_type) == GEANY_FILETYPES_JAVA)
+ return SC_FOLDLEVELBASE + 1;
+ else
+ return SC_FOLDLEVELBASE;
+}
+
+
/* Should be used only with utils_get_current_function. */
static gboolean current_function_changed(gint cur_idx, gint cur_line, gint fold_level)
{
static gint old_line = -2;
static gint old_idx = -1;
- static gint old_fold_level = -1;
+ static gint old_fold_num = -1;
+ const gint fold_num = fold_level & SC_FOLDLEVELNUMBERMASK;
gboolean ret;
// check if the cached line and file index have changed since last time:
@@ -387,18 +399,26 @@
ret = FALSE;
else
{
- // if the line has only changed by 1 and fold_level is the same, return unchanged.
+ // if the line has only changed by 1
if (abs(cur_line - old_line) == 1)
{
- ret = (fold_level != old_fold_level);
+ const gint fn_fold =
+ get_function_fold_number(cur_idx);
+ /* It's the same function if the fold number hasn't changed, or both the new
+ * and old fold numbers are above the function fold number. */
+ gboolean same =
+ fold_num == old_fold_num ||
+ (old_fold_num > fn_fold && fold_num > fn_fold);
+
+ ret = ! same;
}
else ret = TRUE;
}
- //record current line and file index for next time
+ // record current line and file index for next time
old_line = cur_line;
old_idx = cur_idx;
- old_fold_level = fold_level;
+ old_fold_num = fold_num;
return ret;
}
@@ -527,9 +547,7 @@
if (doc_list[idx].file_type != NULL &&
doc_list[idx].file_type->id != GEANY_FILETYPES_ALL)
{
- // for Java the functions are one fold level above the class scope
- gint top_fold_level = (doc_list[idx].file_type->id == GEANY_FILETYPES_JAVA) ?
- SC_FOLDLEVELBASE + 1 : SC_FOLDLEVELBASE;
+ const gint fn_fold = get_function_fold_number(idx);
tag_line = line;
do // find the top level fold point
@@ -537,7 +555,7 @@
tag_line = sci_get_fold_parent(doc_list[idx].sci, tag_line);
fold_level = sci_get_fold_level(doc_list[idx].sci, tag_line);
} while (tag_line >= 0 &&
- (fold_level & SC_FOLDLEVELNUMBERMASK) != top_fold_level);
+ (fold_level & SC_FOLDLEVELNUMBERMASK) != fn_fold);
if (tag_line >= 0)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.