Branch: refs/heads/master
Author: Lex <elextr(a)gmail.com>
Committer: Lex <elextr(a)gmail.com>
Date: Mon, 15 Oct 2012 00:56:03
Commit: 306eaab3916649567c892215ad8390b9d39de82f
https://github.com/geany/geany/commit/306eaab3916649567c892215ad8390b9d39de…
Log Message:
-----------
Alter default and document icon setting
Previous default value prevented the preceding commit from working
(by default), oops.
Modified Paths:
--------------
doc/geany.txt
src/keyfile.c
Modified: doc/geany.txt
2 files changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -2498,6 +2498,8 @@ msgwin_messages_visible Whether to show the Messages tab in the tru
Messages Window
msgwin_scribble_visible Whether to show the Scribble tab in the true immediately
Messages Window
+use_geany_icon Whether to use the Geany icon on the false on restart
+ window instead of the theme's icon
================================ ========================================= ========== ===========
By default, statusbar_template is empty. This tells Geany to use its
Modified: src/keyfile.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -243,7 +243,7 @@ static void init_pref_groups(void)
/* use the Geany icon instead of the theme */
stash_group_add_boolean(group, &main_use_geany_icon,
- "use_geany_icon", TRUE);
+ "use_geany_icon", FALSE);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <matt(a)geany.org>
Date: Sat, 13 Oct 2012 22:37:00
Commit: 4c7ca69be0642aeec9e7d3831d799215d1737b95
https://github.com/geany/geany/commit/4c7ca69be0642aeec9e7d3831d799215d1737…
Log Message:
-----------
Prefer to use Geany icon from theme over inline one
Note that no attempt is made to handle when the icon theme is changed
to update Geany's window icon (ex. using the style-set signal).
Modified Paths:
--------------
src/main.c
Modified: src/main.c
8 files changed, 7 insertions(+), 1 deletions(-)
===================================================================
@@ -1059,7 +1059,13 @@ gint main(gint argc, gchar **argv)
/* set window icon */
{
- GdkPixbuf *pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
+ GdkPixbuf *pb;
+ pb = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "geany", 48, 0, NULL);
+ if (pb == NULL)
+ {
+ g_warning("Unable to find Geany icon in theme, using embedded icon");
+ pb = ui_new_pixbuf_from_inline(GEANY_IMAGE_LOGO);
+ }
gtk_window_set_icon(GTK_WINDOW(main_widgets.window), pb);
g_object_unref(pb); /* free our reference */
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Fri, 12 Oct 2012 18:40:38
Commit: 220ace841ca08baff629e2443df92540aa8fca62
https://github.com/geany/geany/commit/220ace841ca08baff629e2443df92540aa8fc…
Log Message:
-----------
Fix uncommenting multi-line comments when cursor is on a delimiter
If the cursor was inside one of the comment's delimiters, the code used
to look for another delimiter, leading to removing previous comment's
start. Moreover, the code assumed the delimiter will always be found,
leading to improper deletions if a delimiter could not be found (either
because of the above problem or because the comment wasn't terminated).
Also, the code used document_find_text() which, if the searched text
cannot be found on the requested direction, either wraps or asks the
user whether to wrap. Wrapping is wrong if there is more than one
single comment in the file, and the dialog is confusing for the use
since she didn't ask for it.
So, rework the code for it to correctly find the delimiters, and not
to wrap search or ask the user. It is also simpler by reusing some
already existing code.
Modified Paths:
--------------
src/editor.c
Modified: src/editor.c
86 files changed, 54 insertions(+), 32 deletions(-)
===================================================================
@@ -109,6 +109,7 @@ static void read_current_word(GeanyEditor *editor, gint pos, gchar *word, gsize
static void snippets_make_replacements(GeanyEditor *editor, GString *pattern);
static gssize replace_cursor_markers(GeanyEditor *editor, GString *pattern);
static GeanyFiletype *editor_get_filetype_at_current_pos(GeanyEditor *editor);
+static gboolean sci_is_blank_line(ScintillaObject *sci, gint line);
void editor_snippets_free(void)
@@ -2820,47 +2821,68 @@ static void real_comment_multiline(GeanyEditor *editor, gint line_start, gint la
}
-static void real_uncomment_multiline(GeanyEditor *editor)
+/* find @p text inside the range of the current style */
+static gint find_in_current_style(ScintillaObject *sci, const gchar *text, gboolean backwards)
+{
+ gint start = sci_get_current_position(sci);
+ gint end = start;
+ gint len = sci_get_length(sci);
+ gint current_style = sci_get_style_at(sci, start);
+ struct Sci_TextToFind ttf;
+
+ while (start > 0 && sci_get_style_at(sci, start - 1) == current_style)
+ start -= 1;
+ while (end < len && sci_get_style_at(sci, end + 1) == current_style)
+ end += 1;
+
+ ttf.lpstrText = (gchar*) text;
+ ttf.chrg.cpMin = backwards ? end + 1 : start;
+ ttf.chrg.cpMax = backwards ? start : end + 1;
+ return sci_find_text(sci, 0, &ttf);
+}
+
+
+static void sci_delete_line(ScintillaObject *sci, gint line)
+{
+ gint start = sci_get_position_from_line(sci, line);
+ gint len = sci_get_line_length(sci, line);
+ SSM(sci, SCI_DELETERANGE, start, len);
+}
+
+
+static gboolean real_uncomment_multiline(GeanyEditor *editor)
{
/* find the beginning of the multi line comment */
- gint pos, line, len, x;
- gchar *linebuf;
- GeanyDocument *doc;
+ gint start, end, start_line, end_line;
GeanyFiletype *ft;
const gchar *co, *cc;
- g_return_if_fail(editor != NULL && editor->document->file_type != NULL);
- doc = editor->document;
+ g_return_val_if_fail(editor != NULL && editor->document->file_type != NULL, FALSE);
ft = editor_get_filetype_at_current_pos(editor);
if (! filetype_get_comment_open_close(ft, FALSE, &co, &cc))
- g_return_if_reached();
+ g_return_val_if_reached(FALSE);
- /* remove comment open chars */
- pos = document_find_text(doc, co, NULL, 0, TRUE, FALSE, NULL);
- SSM(editor->sci, SCI_DELETEBACK, 0, 0);
+ start = find_in_current_style(editor->sci, co, TRUE);
+ end = find_in_current_style(editor->sci, cc, FALSE);
- /* check whether the line is empty and can be deleted */
- line = sci_get_line_from_position(editor->sci, pos);
- len = sci_get_line_length(editor->sci, line);
- linebuf = sci_get_line(editor->sci, line);
- x = 0;
- while (linebuf[x] != '\0' && isspace(linebuf[x])) x++;
- if (x == len) SSM(editor->sci, SCI_LINEDELETE, 0, 0);
- g_free(linebuf);
+ if (start < 0 || end < 0 || start > end /* who knows */)
+ return FALSE;
+
+ start_line = sci_get_line_from_position(editor->sci, start);
+ end_line = sci_get_line_from_position(editor->sci, end);
/* remove comment close chars */
- pos = document_find_text(doc, cc, NULL, 0, FALSE, FALSE, NULL);
- SSM(editor->sci, SCI_DELETEBACK, 0, 0);
+ SSM(editor->sci, SCI_DELETERANGE, end, strlen(cc));
+ if (sci_is_blank_line(editor->sci, end_line))
+ sci_delete_line(editor->sci, end_line);
- /* check whether the line is empty and can be deleted */
- line = sci_get_line_from_position(editor->sci, pos);
- len = sci_get_line_length(editor->sci, line);
- linebuf = sci_get_line(editor->sci, line);
- x = 0;
- while (linebuf[x] != '\0' && isspace(linebuf[x])) x++;
- if (x == len) SSM(editor->sci, SCI_LINEDELETE, 0, 0);
- g_free(linebuf);
+ /* remove comment open chars (do it last since it would move the end position) */
+ SSM(editor->sci, SCI_DELETERANGE, start, strlen(co));
+ if (sci_is_blank_line(editor->sci, start_line))
+ sci_delete_line(editor->sci, start_line);
+
+ return TRUE;
}
@@ -2993,8 +3015,8 @@ gint editor_do_uncomment(GeanyEditor *editor, gint line, gboolean toggle)
style_comment = get_multiline_comment_style(editor, line_start);
if (sci_get_style_at(editor->sci, line_start + x) == style_comment)
{
- real_uncomment_multiline(editor);
- count = 1;
+ if (real_uncomment_multiline(editor))
+ count = 1;
}
/* break because we are already on the last line */
@@ -3116,8 +3138,8 @@ void editor_do_comment_toggle(GeanyEditor *editor)
style_comment = get_multiline_comment_style(editor, line_start);
if (sci_get_style_at(editor->sci, line_start + x) == style_comment)
{
- real_uncomment_multiline(editor);
- count_uncommented++;
+ if (real_uncomment_multiline(editor))
+ count_uncommented++;
}
else
{
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <matt(a)geany.org>
Date: Fri, 12 Oct 2012 06:07:02
Commit: 206c39cb6aa02e12bbf5d3c5b63f9fd9d95f705f
https://github.com/geany/geany/commit/206c39cb6aa02e12bbf5d3c5b63f9fd9d95f7…
Log Message:
-----------
Fix reshowing calltip after autoc list closed
Using default priority causes Geany's reshowing idle handler to run
before Scintilla's, changing priority to low in hopes of making it
run after.
Modified Paths:
--------------
src/editor.c
Modified: src/editor.c
6 files changed, 4 insertions(+), 2 deletions(-)
===================================================================
@@ -696,8 +696,10 @@ static void request_reshowing_calltip(SCNotification *nt)
if (calltip.set)
{
/* delay the reshow of the calltip window to make sure it is actually displayed,
- * without it might be not visible on SCN_AUTOCCANCEL */
- g_idle_add(reshow_calltip, NULL);
+ * without it might be not visible on SCN_AUTOCCANCEL. the priority is set to
+ * low to hopefully make Scintilla's events happen before reshowing since they
+ * seem to re-cancel the calltip on autoc menu hiding too */
+ g_idle_add_full(G_PRIORITY_LOW, reshow_calltip, NULL, NULL);
}
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).