Revision: 1422
http://svn.sourceforge.net/geany/?rev=1422&view=rev
Author: eht16
Date: 2007-03-25 13:51:45 -0700 (Sun, 25 Mar 2007)
Log Message:
-----------
Use Ctrl+Shift+Space always for showing calltips because Alt+Space is used often by window managers (not only under Windows).
Added keybinding for inserting alternative whitespace characters.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.docbook
trunk/src/keybindings.c
trunk/src/keybindings.h
trunk/src/sci_cb.c
trunk/src/sci_cb.h
trunk/src/utils.c
trunk/src/utils.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/ChangeLog 2007-03-25 20:51:45 UTC (rev 1422)
@@ -1,3 +1,12 @@
+2007-03-25 Enrico Tröger <enrico.troeger(a)uvena.de>
+
+ * doc/geany.docbook, src/keybindings.c, src/keybindings.h,
+ src/sci_cb.c, src/sci_cb.h, src/utils.c, src/utils.h:
+ Use Ctrl+Shift+Space always for showing calltips because Alt+Space is
+ used often by window managers (not only under Windows).
+ Added keybinding for inserting alternative whitespace characters.
+
+
2007-03-24 Nick Treleaven <nick.treleaven(a)btinternet.com>
* src/sci_cb.c, src/symbols.c:
Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/doc/geany.docbook 2007-03-25 20:51:45 UTC (rev 1422)
@@ -1515,6 +1515,14 @@
</entry>
</row>
<row>
+ <entry>Insert alternative whitespace</entry>
+ <entry>Inserts a tabulator character when spaces should be used for
+ indentation and inserts space characters of the amount of a
+ tabulator width when tabulators should be used for
+ indentation.
+ </entry>
+ </row>
+ <row>
<entry>Find Usage</entry>
<entry>Finds all occurrences of the current word (near the
keyboard cursor) and displays them in the messages window.
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/src/keybindings.c 2007-03-25 20:51:45 UTC (rev 1422)
@@ -250,14 +250,8 @@
_("Goto previous marker"));
keys[GEANY_KEYS_EDIT_AUTOCOMPLETE] = fill(cb_func_edit,
GDK_space, GDK_CONTROL_MASK, "edit_autocomplete", _("Complete word"));
-#ifdef G_OS_WIN32
- // on windows alt-space is taken by the window manager
keys[GEANY_KEYS_EDIT_CALLTIP] = fill(cb_func_edit,
GDK_space, GDK_CONTROL_MASK | GDK_SHIFT_MASK, "edit_calltip", _("Show calltip"));
-#else
- keys[GEANY_KEYS_EDIT_CALLTIP] = fill(cb_func_edit,
- GDK_space, GDK_MOD1_MASK, "edit_calltip", _("Show calltip"));
-#endif
keys[GEANY_KEYS_EDIT_MACROLIST] = fill(cb_func_edit,
GDK_Return, GDK_CONTROL_MASK, "edit_macrolist", _("Show macro list"));
keys[GEANY_KEYS_EDIT_SUPPRESSCOMPLETION] = fill(cb_func_edit,
@@ -266,6 +260,9 @@
keys[GEANY_KEYS_EDIT_SELECTWORD] = fill(cb_func_edit,
0, 0, "edit_selectword", _("Select current word"));
+ keys[GEANY_KEYS_EDIT_INSERTALTWHITESPACE] = fill(cb_func_edit,
+ 0, 0, "edit_insertwhitespace", _("Insert alternative whitespace"));
+
keys[GEANY_KEYS_POPUP_FINDUSAGE] = fill(cb_func_current_word,
0, 0, "popup_findusage", _("Find Usage"));
keys[GEANY_KEYS_POPUP_GOTOTAGDEFINITION] = fill(cb_func_current_word,
@@ -948,6 +945,9 @@
case GEANY_KEYS_EDIT_SELECTWORD:
sci_cb_select_word(doc_list[idx].sci);
break;
+ case GEANY_KEYS_EDIT_INSERTALTWHITESPACE:
+ sci_cb_insert_alternative_whitespace(doc_list[idx].sci);
+ break;
case GEANY_KEYS_EDIT_INCREASEINDENT:
on_menu_increase_indent1_activate(NULL, NULL);
break;
Modified: trunk/src/keybindings.h
===================================================================
--- trunk/src/keybindings.h 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/src/keybindings.h 2007-03-25 20:51:45 UTC (rev 1422)
@@ -113,6 +113,7 @@
GEANY_KEYS_EDIT_MACROLIST,
GEANY_KEYS_EDIT_SUPPRESSCOMPLETION,
GEANY_KEYS_EDIT_SELECTWORD,
+ GEANY_KEYS_EDIT_INSERTALTWHITESPACE,
GEANY_KEYS_POPUP_FINDUSAGE,
GEANY_KEYS_POPUP_GOTOTAGDEFINITION,
GEANY_KEYS_POPUP_GOTOTAGDECLARATION,
Modified: trunk/src/sci_cb.c
===================================================================
--- trunk/src/sci_cb.c 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/src/sci_cb.c 2007-03-25 20:51:45 UTC (rev 1422)
@@ -347,7 +347,7 @@
sci_get_style_at(sci, pos - 2) == SCE_P_OPERATOR)
{
// creates and inserts one tabulator sign or whitespace of the amount of the tab width
- gchar *text = utils_get_whitespace(app->pref_editor_tab_width);
+ gchar *text = utils_get_whitespace(app->pref_editor_tab_width, FALSE);
sci_add_text(sci, text);
g_free(text);
}
@@ -993,7 +993,7 @@
}
// get the whitespace for additional indentation
- space = utils_get_whitespace(app->pref_editor_tab_width);
+ space = utils_get_whitespace(app->pref_editor_tab_width, FALSE);
space_len = strlen(space);
// "pattern", buf + x, y -> x + y = 15, because buf is (pos - 16)...(pos - 1) = 15
@@ -2144,6 +2144,15 @@
}
+void sci_cb_insert_alternative_whitespace(ScintillaObject *sci)
+{
+ // creates and inserts one tabulator sign or whitespace of the amount of the tab width
+ gchar *text = utils_get_whitespace(app->pref_editor_tab_width, TRUE);
+ sci_add_text(sci, text);
+ g_free(text);
+}
+
+
void sci_cb_select_word(ScintillaObject *sci)
{
gint pos;
Modified: trunk/src/sci_cb.h
===================================================================
--- trunk/src/sci_cb.h 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/src/sci_cb.h 2007-03-25 20:51:45 UTC (rev 1422)
@@ -88,4 +88,6 @@
void sci_cb_select_word(ScintillaObject *sci);
+void sci_cb_insert_alternative_whitespace(ScintillaObject *sci);
+
#endif
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/src/utils.c 2007-03-25 20:51:45 UTC (rev 1422)
@@ -1449,14 +1449,18 @@
/* Returns a string containing whitespace of the amount a according to the
* setting app->pref_editor_use_tabs filled with simple space characters or with the right amount
* of tabulator characters (a is filled with tabulators *and* spaces if a isn't a multiple of
- * app->pref_editor_tab_width) */
-gchar *utils_get_whitespace(gint a)
+ * app->pref_editor_tab_width).
+ * If alternative is set to TRUE, it returns the opposite of app->pref_editor_use_tabs. */
+gchar *utils_get_whitespace(gint a, gboolean alternative)
{
gchar *str;
+ gboolean use_tabs;
g_return_val_if_fail(a > 0, NULL);
- if (app->pref_editor_use_tabs)
+ use_tabs = (alternative) ? ! app->pref_editor_use_tabs : app->pref_editor_use_tabs;
+
+ if (use_tabs)
{ // first fill text with tabluators and fill the rest with spaces
gint tabs = a / app->pref_editor_tab_width;
gint spaces = a % app->pref_editor_tab_width;
Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h 2007-03-24 16:27:19 UTC (rev 1421)
+++ trunk/src/utils.h 2007-03-25 20:51:45 UTC (rev 1422)
@@ -148,8 +148,9 @@
/* Returns a string containing whitespace of the amount a according to the
* setting app->pref_editor_use_tabs filled with simple space characters or with the right amount
* of tabulator characters (a is filled with tabulators *and* spaces if a isn't a multiple of
- * app->pref_editor_tab_width) */
-gchar *utils_get_whitespace(gint amount);
+ * app->pref_editor_tab_width).
+ * If alternative is set to TRUE, it returns the opposite of app->pref_editor_use_tabs. */
+gchar *utils_get_whitespace(gint amount, gboolean alternative);
/* frees all passed pointers if they are non-NULL, the first argument is nothing special,
* it will also be freed, the list should be ended with NULL */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1421
http://svn.sourceforge.net/geany/?rev=1421&view=rev
Author: ntrel
Date: 2007-03-24 09:27:19 -0700 (Sat, 24 Mar 2007)
Log Message:
-----------
Don't beep when pressing escape to close the Find or Replace dialogs.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/search.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-03-24 16:10:20 UTC (rev 1420)
+++ trunk/ChangeLog 2007-03-24 16:27:19 UTC (rev 1421)
@@ -11,6 +11,8 @@
* src/keybindings.c:
Ignore Caps Lock in keybindings_got_event() (could cause problems
with e.g. Shift-F9).
+ * src/search.c:
+ Don't beep when pressing escape to close the Find or Replace dialogs.
2007-03-23 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2007-03-24 16:10:20 UTC (rev 1420)
+++ trunk/src/search.c 2007-03-24 16:27:19 UTC (rev 1421)
@@ -815,7 +815,7 @@
static void
on_find_dialog_response(GtkDialog *dialog, gint response, gpointer user_data)
{
- if (response == GTK_RESPONSE_CANCEL)
+ if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_DELETE_EVENT)
gtk_widget_hide(widgets.find_dialog);
else
{
@@ -879,8 +879,6 @@
search_mark(idx, search_data.text, search_data.flags);
break;
}
-
- // Note: we can get GTK_RESPONSE_DELETE_EVENT responses when ESC is pressed
}
if (check_close)
gtk_widget_hide(widgets.find_dialog);
@@ -907,7 +905,7 @@
gboolean close_window;
gchar *find, *replace;
- if (response == GTK_RESPONSE_CANCEL)
+ if (response == GTK_RESPONSE_CANCEL || response == GTK_RESPONSE_DELETE_EVENT)
{
gtk_widget_hide(widgets.replace_dialog);
return;
@@ -1007,7 +1005,6 @@
if (close_window) gtk_widget_hide(widgets.replace_dialog);
break;
}
- // Note: we can get GTK_RESPONSE_DELETE_EVENT responses when ESC is pressed
}
g_free(find);
g_free(replace);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 1420
http://svn.sourceforge.net/geany/?rev=1420&view=rev
Author: ntrel
Date: 2007-03-24 09:10:20 -0700 (Sat, 24 Mar 2007)
Log Message:
-----------
Ignore Caps Lock in keybindings_got_event() (could cause problems
with e.g. Shift-F9).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/keybindings.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-03-24 12:50:19 UTC (rev 1419)
+++ trunk/ChangeLog 2007-03-24 16:10:20 UTC (rev 1420)
@@ -8,6 +8,9 @@
Move dialogs_show_includes_arguments_*() to build.c.
Move on_includes_arguments_*dialog_response() to build.c.
Make several build functions static.
+ * src/keybindings.c:
+ Ignore Caps Lock in keybindings_got_event() (could cause problems
+ with e.g. Shift-F9).
2007-03-23 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2007-03-24 12:50:19 UTC (rev 1419)
+++ trunk/src/keybindings.c 2007-03-24 16:10:20 UTC (rev 1420)
@@ -524,6 +524,11 @@
{
guint i, k;
+ if (event->state & GDK_LOCK_MASK)
+ event->state -= GDK_LOCK_MASK; // ignore caps-lock
+ // ignore numlock key, not necessary but nice
+ if (event->state & GDK_MOD2_MASK) event->state -= GDK_MOD2_MASK;
+
if (check_fixed_kb(event)) return TRUE;
for (i = 0; i < GEANY_MAX_KEYS; i++)
@@ -538,9 +543,6 @@
if (keys[i]->key >= GDK_a && keys[i]->key <= GDK_z) k = keys[i]->key - 32;
}
- // ignore numlock key, not necessary but nice
- if (event->state & GDK_MOD2_MASK) event->state -= GDK_MOD2_MASK;
-
if (event->keyval == k && event->state == keys[i]->mods)
{
// call the corresponding callback function for this shortcut
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.