Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Mon, 16 Oct 2023 21:11:14 UTC Commit: 6d4ad0ffc3d46f8ce2e08e43eb3f73a9ace50703 https://github.com/geany/geany-osx/commit/6d4ad0ffc3d46f8ce2e08e43eb3f73a9ac...
Log Message: ----------- Remove now unneeded patches
Modified Paths: -------------- geany.modules geany_patches/geany_colors.patch geany_patches/geany_config_shell.patch geany_patches/geany_plugins_geanylua_remove_x11_dependency.patch geany_patches/geany_plugins_vimode_caret_fix.patch geany_patches/geany_plugins_vimode_eol_eof_fix.patch geany_patches/geany_plugins_vimode_height.patch geany_patches/geany_plugins_vimode_numlock_fix.patch geany_patches/geany_scintilla_block_copy.patch geany_patches/geany_vte_login_shell.patch geany_patches/geany_workaround_meson_expecting_git_repository.patch geany_patches/git-geany_config_shell.patch geany_patches/git-geany_scintilla_block_copy.patch geany_patches/git-geany_vte_login_shell.patch
Modified: geany.modules 15 lines changed, 3 insertions(+), 12 deletions(-) =================================================================== @@ -104,11 +104,10 @@ checkoutdir="geany-git" version="master" > <!-- This patch corresponds to https://github.com/geany/geany/pull/2363 --> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/git-geany_config_shell.patch" strip="1" /> + <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_config_shell.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_scintilla_candidate_window_pos.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/git-geany_vte_login_shell.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_workaround_meson_expecting_git_repository.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/git-geany_scintilla_block_copy.patch" strip="1" /> + <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_vte_login_shell.patch" strip="1" /> + <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_scintilla_block_copy.patch" strip="1" /> </branch> <dependencies> <dep package="geany-deps" /> @@ -128,8 +127,6 @@ <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_scintilla_candidate_window_pos.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_vte_login_shell.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_scintilla_block_copy.patch" strip="1" /> - <!-- TODO: remove for the next release --> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_colors.patch" strip="1" /> </branch> <dependencies> <dep package="geany-deps" /> @@ -174,12 +171,6 @@ <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_spellcheck_relocation.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_geanylua_link_against_statically_built_liblua.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_geanylua_make_lib_data_directories_relocatable.patch" strip="1" /> - <!-- TODO: remove once merged upstream --> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_vimode_height.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_vimode_eol_eof_fix.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_vimode_caret_fix.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_vimode_numlock_fix.patch" strip="1" /> - <patch file="https://github.com/geany/geany-osx/raw/master/geany_patches/geany_plugins_geanylua_remove_x11_dependency.patch" strip="1" /> </branch> <dependencies> <dep package="geany-release" />
Modified: geany_patches/geany_colors.patch 68 lines changed, 0 insertions(+), 68 deletions(-) =================================================================== @@ -1,68 +0,0 @@ -From 95c9947e6c54ce2570c25b7724264981a76bdc2e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Sat, 20 Nov 2021 18:18:18 +0100 -Subject: [PATCH] Use dark-theme friendly colors for compiler messages - -These colors seem to provide good legibility for both light and dark -themes and seem to be better defaults regardless of what theme users -use. ---- - data/filedefs/filetypes.common | 2 +- - data/geany.css | 14 +++++++------- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/data/filedefs/filetypes.common b/data/filedefs/filetypes.common -index a749bb2d..38a4e974 100644 ---- a/data/filedefs/filetypes.common -+++ b/data/filedefs/filetypes.common -@@ -94,7 +94,7 @@ line_height=0;0; - calltips=call_tips - - # error indicator color --indicator_error=0xff0000 -+indicator_error=0xff3030 - - [settings] - # which characters should be skipped when moving (or included when deleting) to word boundaries -diff --git a/data/geany.css b/data/geany.css -index ff1fe354..41a7aa00 100644 ---- a/data/geany.css -+++ b/data/geany.css -@@ -28,27 +28,27 @@ - - /* document status colors */ - #geany-document-status-changed { -- color: #ff0000; -+ color: #ff3030; - } - #geany-document-status-disk-changed { -- color: #ff7f00; -+ color: #ee8000; - } - #geany-document-status-readonly { -- color: #007f00; -+ color: #309030; - } - - /* compiler message colors */ - #geany-compiler-error { -- color: #ff0000; -+ color: #ff3030; - } - #geany-compiler-context { -- color: #7f0000; -+ color: #ee8000; - } - #geany-compiler-message { -- color: #0000D0; -+ color: #006eff; - } - - /* red "Terminal" label when terminal dirty */ - #geany-terminal-dirty { -- color: #ff0000; -+ color: #ff3030; - } --- -2.31.1 -
Modified: geany_patches/geany_config_shell.patch 72 lines changed, 36 insertions(+), 36 deletions(-) =================================================================== @@ -50,71 +50,71 @@ index 3864a0ad1..79cf7c4b9 100644 @@ -4798,7 +4798,7 @@ <object class="GtkTable" id="table1"> <property name="visible">True</property> - <property name="can_focus">False</property> -- <property name="n_rows">3</property> -+ <property name="n_rows">4</property> - <property name="n_columns">3</property> - <property name="column_spacing">6</property> - <property name="row_spacing">3</property> + <property name="can-focus">False</property> +- <property name="n-rows">3</property> ++ <property name="n-rows">4</property> + <property name="n-columns">3</property> + <property name="column-spacing">6</property> + <property name="row-spacing">3</property> @@ -4960,6 +4960,63 @@ - <property name="y_options"/> + <property name="y-options"/> </packing> </child> + <child> + <object class="GtkLabel" id="label27"> + <property name="visible">True</property> -+ <property name="can_focus">False</property> ++ <property name="can-focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Shell:</property> -+ <property name="mnemonic_widget">entry_grep</property> ++ <property name="mnemonic-widget">entry_grep</property> + </object> + <packing> -+ <property name="top_attach">3</property> -+ <property name="bottom_attach">4</property> -+ <property name="x_options">GTK_FILL</property> -+ <property name="y_options"/> ++ <property name="top-attach">3</property> ++ <property name="bottom-attach">4</property> ++ <property name="x-options">GTK_FILL</property> ++ <property name="y-options"/> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_shell1"> + <property name="visible">True</property> -+ <property name="can_focus">True</property> -+ <property name="tooltip_text" translatable="yes">Shell used for build commands (useful to get environment set up from the shell's config files)</property> -+ <property name="invisible_char">•</property> -+ <property name="invisible_char_set">True</property> -+ <property name="primary_icon_activatable">False</property> -+ <property name="secondary_icon_activatable">False</property> -+ <property name="primary_icon_sensitive">True</property> -+ <property name="secondary_icon_sensitive">True</property> ++ <property name="can-focus">True</property> ++ <property name="tooltip-text" translatable="yes">Shell used for build commands (useful to get environment set up from the shell's config files)</property> ++ <property name="invisible-char">•</property> ++ <property name="invisible-char-set">True</property> ++ <property name="primary-icon-activatable">False</property> ++ <property name="secondary-icon-activatable">False</property> ++ <property name="primary-icon-sensitive">True</property> ++ <property name="secondary-icon-sensitive">True</property> + </object> + <packing> -+ <property name="left_attach">1</property> -+ <property name="right_attach">2</property> -+ <property name="top_attach">3</property> -+ <property name="bottom_attach">4</property> -+ <property name="y_options"/> ++ <property name="left-attach">1</property> ++ <property name="right-attach">2</property> ++ <property name="top-attach">3</property> ++ <property name="bottom-attach">4</property> ++ <property name="y-options"/> + </packing> + </child> + <child> + <object class="GtkButton" id="button_shell"> + <property name="visible">True</property> -+ <property name="can_focus">True</property> -+ <property name="receives_default">False</property> ++ <property name="can-focus">True</property> ++ <property name="receives-default">False</property> + <child> -+ <object class="GtkImage" id="image7"> ++ <object class="GtkImage" id="image777X"> + <property name="visible">True</property> -+ <property name="can_focus">False</property> ++ <property name="can-focus">False</property> + <property name="stock">gtk-open</property> + </object> + </child> + </object> + <packing> -+ <property name="left_attach">2</property> -+ <property name="right_attach">3</property> -+ <property name="top_attach">3</property> -+ <property name="bottom_attach">4</property> -+ <property name="x_options">GTK_FILL</property> -+ <property name="y_options"/> ++ <property name="left-attach">2</property> ++ <property name="right-attach">3</property> ++ <property name="top-attach">3</property> ++ <property name="bottom-attach">4</property> ++ <property name="x-options">GTK_FILL</property> ++ <property name="y-options"/> + </packing> + </child> </object>
Modified: geany_patches/geany_plugins_geanylua_remove_x11_dependency.patch 269 lines changed, 0 insertions(+), 269 deletions(-) =================================================================== @@ -1,269 +0,0 @@ -From b061ff8aa1ef04402905339ad655043564d07207 Mon Sep 17 00:00:00 2001 -From: xiota github@mentalfossa.com -Date: Sun, 5 Mar 2023 17:53:10 -0800 -Subject: [PATCH 1/2] GeanyLua: Fix geany.keygrab * Make platform agnostic * - Fix infinite loop * Update documentation - ---- - geanylua/docs/geanylua-ref.html | 57 +++++----- - geanylua/glspi_app.c | 188 +++++++++----------------------- - 2 files changed, 78 insertions(+), 167 deletions(-) - -diff --git a/geanylua/glspi_app.c b/geanylua/glspi_app.c -index 14d2e780..e5a7b48c 100644 ---- a/geanylua/glspi_app.c -+++ b/geanylua/glspi_app.c -@@ -439,170 +439,82 @@ static gint glspi_launch(lua_State* L) - } - - --static guint My_Shift_L=0; --static guint My_Shift_R=0; --static guint My_Control_L=0; --static guint My_Control_R=0; --static guint My_Alt_L=0; --static guint My_Alt_R=0; -- -- --#ifndef G_OS_WIN32 -- --#include <X11/Xlib.h> --#include <X11/keysym.h> -- -- --#define IsShift ( (My_Shift_L == ev->xkey.keycode) || (My_Shift_R == ev->xkey.keycode) ) -- --#define IsCtrl ( (My_Control_L == ev->xkey.keycode) || (My_Control_R == ev->xkey.keycode) ) --#define IsAlt ( (My_Alt_L == ev->xkey.keycode) || (My_Alt_R == ev->xkey.keycode) ) -- --#define IsCtrlAlt ( IsCtrl || IsAlt ) -- - typedef struct _KeyGrabData { --gchar *prompt; --GdkKeymapKey km; -+ gboolean keypress; -+ guint keyval; - } _KeyGrabData; - - --static GdkFilterReturn keygrab_cb(GdkXEvent *xevent, GdkEvent *event, gpointer data) -+static gboolean keygrab_cb(GtkWidget *widget, GdkEventKey *ev, gpointer data) - { -- XEvent*ev = (XEvent*) xevent; -- GdkKeymapKey *km = (GdkKeymapKey*) data; -- switch (ev->type) { -- case KeyPress:{ -- if (IsShift) { -- km->level=1; -- } else { -- if (!IsCtrlAlt) km->group=1; /* Flag to know we have keydown before keyup */ -- } -- return GDK_FILTER_REMOVE; -- } -- case KeyRelease:{ -- if (IsShift) { -- km->level=0; -- } else { -- if ((km->group==1)&&(!IsCtrlAlt)) { /* OK, we already got our keydown */ -- km->group=2; -- km->level=(ev->xkey.state & ShiftMask)?1:0; -- km->keycode=ev->xkey.keycode; -- } -- } -- return GDK_FILTER_REMOVE; -- } -- default:{} -- } -- return GDK_FILTER_CONTINUE; --} -+ _KeyGrabData *km = (_KeyGrabData*) data; - --#define dosleep() g_usleep(1) -+ if (ev->keyval == 0) { -+ return FALSE; -+ } - --#else --#include <windows.h> --#define dosleep() Sleep(1) -+ km->keyval = ev->keyval; -+ km->keypress = TRUE; -+ return TRUE; -+} - --#define IsShift ( (My_Shift_L == msg->wParam) || (My_Shift_R == msg->wParam) ) - --#define IsCtrl ( (My_Control_L == msg->wParam) || (My_Control_R == msg->wParam) ) --#define IsAlt ( (My_Alt_L == msg->wParam) || (My_Alt_R == msg->wParam) ) -+static gint glspi_keygrab(lua_State* L) -+{ -+ GeanyDocument *doc = NULL; -+ const gchar *prompt = NULL; -+ static gulong keygrab_cb_handle = 0; - --#define IsCtrlAlt ( IsCtrl || IsAlt ) - -+ _KeyGrabData km; -+ km.keypress = FALSE; -+ km.keyval = 0; - --static GdkFilterReturn keygrab_cb(GdkXEvent *xevent, GdkEvent *event, gpointer data) --{ -- MSG*msg = (MSG*) xevent; -- GdkKeymapKey *km = (GdkKeymapKey*) data; -- switch (msg->message) { -- case WM_KEYDOWN:{ -- if (IsShift) { -- km->level=1; -- } else { -- if (!IsCtrlAlt) km->group=1; /* Flag to know we have keydown before keyup */ -- } -- return GDK_FILTER_REMOVE; -- } -- case WM_KEYUP:{ -- if (IsShift) { -- km->level=0; -- } else { -- if ((km->group==1)&&(!IsCtrlAlt)) { /* OK, we already got our keydown */ -- km->group=2; -- km->level=HIBYTE(GetKeyState(VK_SHIFT))?1:0; -- km->keycode=msg->wParam; -- } -- } -- return GDK_FILTER_REMOVE; -+ /* get prompt, if exists */ -+ if (lua_gettop(L) > 0) { -+ if (!lua_isstring(L, 1)) { -+ return FAIL_STRING_ARG(1); - } -- default:{} -+ prompt = lua_tostring(L,1); -+ doc = document_get_current(); - } -- return GDK_FILTER_CONTINUE; --} -- - --#endif -- -- --#include <gdk/gdkkeysyms.h> --static gint init_key(guint keyval){ -- GdkKeymapKey *kmk=NULL; -- GdkKeymap *gdk_key_map=gdk_keymap_get_default(); -- gint n_keys=0; -- gint rv=0; -- if (gdk_keymap_get_entries_for_keyval(gdk_key_map,keyval,&kmk,&n_keys)) { -- rv=kmk[0].keycode; -- g_free(kmk); -+ /* show prompt in tooltip */ -+ if (prompt && doc && doc->is_valid ) { -+ gint fvl = scintilla_send_message(doc->editor->sci, SCI_GETFIRSTVISIBLELINE, 0, 0); -+ gint pos = sci_get_position_from_line(doc->editor->sci, fvl+1); -+ scintilla_send_message(doc->editor->sci, SCI_CALLTIPSHOW, pos+3, (sptr_t) prompt); - } -- return rv; --} -- --#define InitKey(code,value) if (!code) { code=init_key(value); } - --static gint glspi_keygrab(lua_State* L) --{ -- GeanyDocument*doc=NULL; -- const gchar*prompt=NULL; -- GdkKeymapKey km={0,0,0}; -- GdkKeymap *gdk_key_map; -- km.keycode=0; -- km.group=0; /* Note: we hijack this field to use as a flag for first keydown. */ -- km.level=0; -- InitKey(My_Shift_L, GDK_Shift_L); -- InitKey(My_Shift_R, GDK_Shift_R); -- InitKey(My_Control_L, GDK_Control_L); -- InitKey(My_Control_R, GDK_Control_R); -- InitKey(My_Alt_L, GDK_Alt_L); -- InitKey(My_Alt_R, GDK_Alt_R); -- if (lua_gettop(L)>0) { -- if (!lua_isstring(L,1)) {return FAIL_STRING_ARG(1); } -- prompt=lua_tostring(L,1); -- doc=document_get_current(); -+ /* callback to handle keypress -+ only one keygrab callback can be running at a time, otherwise geanylua will hang -+ */ -+ if (!keygrab_cb_handle) { -+ keygrab_cb_handle = g_signal_connect(main_widgets->window, "key-press-event", G_CALLBACK(keygrab_cb), &km); -+ } else { -+ lua_pushnil(L); -+ return 1; - } - -- if (prompt && doc && doc->is_valid ) { -- gint fvl=scintilla_send_message(doc->editor->sci,SCI_GETFIRSTVISIBLELINE, 0,0); -- gint pos=sci_get_position_from_line(doc->editor->sci, fvl+1); -- scintilla_send_message(doc->editor->sci,SCI_CALLTIPSHOW,pos+3, (sptr_t)prompt); -- } -- gdk_window_add_filter(gtk_widget_get_window(main_widgets->window), keygrab_cb, &km); -- do { -+ /* wait for keypress */ -+ while (!km.keypress) { - while (gtk_events_pending()) { -- if (km.group==2) { break; } -+ if (km.keypress) { -+ break; -+ } - gtk_main_iteration(); - } -- if (km.group==2) { break; } -- dosleep(); -- } while (km.group!=2); -+ } -+ -+ /* clear callback */ -+ g_clear_signal_handler(&keygrab_cb_handle, main_widgets->window); - -- gdk_window_remove_filter(gtk_widget_get_window(main_widgets->window), keygrab_cb, &km); -+ /* clear tooltip */ - if (prompt && doc && doc->is_valid) { -- sci_send_command(doc->editor->sci, SCI_CALLTIPCANCEL); -+ sci_send_command(doc->editor->sci, SCI_CALLTIPCANCEL); - } -- km.group=0; /* reset the hijacked flag before passing to GDK */ -- gdk_key_map = gdk_keymap_get_default(); -- lua_pushstring(L, gdk_keyval_name(gdk_keymap_lookup_key(gdk_key_map, &km))); - -+ lua_pushstring(L, gdk_keyval_name(km.keyval)); - return 1; - } - --- -2.37.5 - - -From 3c2e16a9d5834b1f153a2557ac819386481a9c2e Mon Sep 17 00:00:00 2001 -From: xiota github@mentalfossa.com -Date: Sun, 5 Mar 2023 18:13:57 -0800 -Subject: [PATCH 2/2] Use g_signal_handler_disconnect instead of - g_clear_signal_handler - ---- - geanylua/glspi_app.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/geanylua/glspi_app.c b/geanylua/glspi_app.c -index e5a7b48c..d21f8ba6 100644 ---- a/geanylua/glspi_app.c -+++ b/geanylua/glspi_app.c -@@ -506,8 +506,9 @@ static gint glspi_keygrab(lua_State* L) - } - } - -- /* clear callback */ -- g_clear_signal_handler(&keygrab_cb_handle, main_widgets->window); -+ /* remove callback and clear handle */ -+ g_signal_handler_disconnect(main_widgets->window, keygrab_cb_handle); -+ keygrab_cb_handle = 0; - - /* clear tooltip */ - if (prompt && doc && doc->is_valid) { --- -2.37.5 -
Modified: geany_patches/geany_plugins_vimode_caret_fix.patch 65 lines changed, 0 insertions(+), 65 deletions(-) =================================================================== @@ -1,65 +0,0 @@ -From cb28b2f334d38bb78bcb15efd37f2c20172c499b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Wed, 24 Nov 2021 00:13:29 +0100 -Subject: [PATCH] vimode: avoid caret position change when inserting EOL at EOF - -When current position is changed in the document and this position is -outside the visibility of the current screen, when returning -back, the call of SCI_GOTOPOS causes window scroll to a different position -than before. - -To avoid this problem, insert_eof_nl_if_missing() and remove_char_from_eof() -avoid setting the position now and, instead, insert/remove the EOL -character using operations that don't change caret position. ---- - vimode/src/cmds/edit.c | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/vimode/src/cmds/edit.c b/vimode/src/cmds/edit.c -index 8e687257..ecdd0dd1 100644 ---- a/vimode/src/cmds/edit.c -+++ b/vimode/src/cmds/edit.c -@@ -83,16 +83,21 @@ void cmd_clear_right(CmdContext *c, CmdParams *p) - - static gboolean insert_eof_nl_if_missing(CmdParams *p) - { -- gint pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - gint eof_pos = SSM(p->sci, SCI_GETLENGTH, 0, 0); - gint eof_line_num = SSM(p->sci, SCI_LINEFROMPOSITION, eof_pos, 0); - gint before_eof = PREV(p->sci, eof_pos); - gint before_eof_line_num = SSM(p->sci, SCI_LINEFROMPOSITION, before_eof, 0); - - if (eof_line_num == before_eof_line_num) { -- SET_POS(p->sci, eof_pos, FALSE); -- SSM(p->sci, SCI_NEWLINE, 0, 0); -- SET_POS(p->sci, pos, FALSE); -+ const gchar *nl = "\n"; -+ gint eol_mode = SSM(p->sci, SCI_GETEOLMODE, 0, 0); -+ if (eol_mode == SC_EOL_CRLF) { -+ nl = "\r\n"; -+ } -+ else if (eol_mode == SC_EOL_CR) { -+ nl = "\r"; -+ } -+ SSM(p->sci, SCI_INSERTTEXT, eof_pos, (sptr_t)nl); - return TRUE; - } - return FALSE; -@@ -101,12 +106,10 @@ static gboolean insert_eof_nl_if_missing(CmdParams *p) - - static void remove_char_from_eof(CmdParams *p) - { -- gint pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); - gint eof_pos = SSM(p->sci, SCI_GETLENGTH, 0, 0); -+ gint before_eof_pos = PREV(p->sci, eof_pos); - -- SET_POS(p->sci, eof_pos, FALSE); -- SSM(p->sci, SCI_DELETEBACK, 0, 0); -- SET_POS(p->sci, pos, FALSE); -+ SSM(p->sci, SCI_DELETERANGE, before_eof_pos, eof_pos - before_eof_pos); - } - - --- -2.31.1 -
Modified: geany_patches/geany_plugins_vimode_eol_eof_fix.patch 54 lines changed, 0 insertions(+), 54 deletions(-) =================================================================== @@ -1,54 +0,0 @@ -From c1e848aca29ef9b673b1378da10cb8e625668779 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Tue, 23 Nov 2021 23:17:49 +0100 -Subject: [PATCH] vimode: fix detection of missing EOL at EOF - -The previous code was incorrect. The new code just - -1. Goes to the last position in document -2. Goes one position before that -3. Checks if the lines corresponding to (1) and (2) are identical - in this -case the NL is missing at EOF ---- - vimode/src/cmds/edit.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/vimode/src/cmds/edit.c b/vimode/src/cmds/edit.c -index d23b8e82..8e687257 100644 ---- a/vimode/src/cmds/edit.c -+++ b/vimode/src/cmds/edit.c -@@ -84,12 +84,13 @@ void cmd_clear_right(CmdContext *c, CmdParams *p) - static gboolean insert_eof_nl_if_missing(CmdParams *p) - { - gint pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); -- gint last_line = SSM(p->sci, SCI_GETLINECOUNT, 0, 0); -- gint line_start_pos = SSM(p->sci, SCI_POSITIONFROMLINE, last_line, 0); -- gint line_end_pos = SSM(p->sci, SCI_GETLINEENDPOSITION, last_line, 0); -+ gint eof_pos = SSM(p->sci, SCI_GETLENGTH, 0, 0); -+ gint eof_line_num = SSM(p->sci, SCI_LINEFROMPOSITION, eof_pos, 0); -+ gint before_eof = PREV(p->sci, eof_pos); -+ gint before_eof_line_num = SSM(p->sci, SCI_LINEFROMPOSITION, before_eof, 0); - -- if (line_start_pos == line_end_pos) { -- SET_POS(p->sci, line_end_pos, FALSE); -+ if (eof_line_num == before_eof_line_num) { -+ SET_POS(p->sci, eof_pos, FALSE); - SSM(p->sci, SCI_NEWLINE, 0, 0); - SET_POS(p->sci, pos, FALSE); - return TRUE; -@@ -101,10 +102,9 @@ static gboolean insert_eof_nl_if_missing(CmdParams *p) - static void remove_char_from_eof(CmdParams *p) - { - gint pos = SSM(p->sci, SCI_GETCURRENTPOS, 0, 0); -- gint last_line = SSM(p->sci, SCI_GETLINECOUNT, 0, 0); -- gint line_end_pos = SSM(p->sci, SCI_GETLINEENDPOSITION, last_line, 0); -+ gint eof_pos = SSM(p->sci, SCI_GETLENGTH, 0, 0); - -- SET_POS(p->sci, line_end_pos, FALSE); -+ SET_POS(p->sci, eof_pos, FALSE); - SSM(p->sci, SCI_DELETEBACK, 0, 0); - SET_POS(p->sci, pos, FALSE); - } --- -2.31.1 -
Modified: geany_patches/geany_plugins_vimode_height.patch 12 lines changed, 0 insertions(+), 12 deletions(-) =================================================================== @@ -1,12 +0,0 @@ -diff --git a/vimode/src/excmd-prompt.c b/vimode/src/excmd-prompt.c -index 93848ca88037051dfc340707790cd560e2596a76..44e9d434c8bb8c9335ced85f49123cc29ba92172 100644 ---- a/vimode/src/excmd-prompt.c -+++ b/vimode/src/excmd-prompt.c -@@ -225,6 +225,7 @@ void ex_prompt_init(GtkWidget *parent_window, CmdContext *c) - prompt = g_object_new(GTK_TYPE_WINDOW, - "decorated", FALSE, - "default-width", PROMPT_WIDTH, -+ "default-height", 1, - "transient-for", parent_window, - "window-position", GTK_WIN_POS_CENTER_ON_PARENT, - "type-hint", GDK_WINDOW_TYPE_HINT_DIALOG,
Modified: geany_patches/geany_plugins_vimode_numlock_fix.patch 30 lines changed, 0 insertions(+), 30 deletions(-) =================================================================== @@ -1,30 +0,0 @@ -From 856f3f7ceaf54561a6fcca8707fe7ab5b444444c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Wed, 24 Nov 2021 15:48:55 +0100 -Subject: [PATCH] vimode: fix escape not working when numlock is on - -It seems that GDK_MOD2_MASK isn't the right modifier to check for -command pressed - its mapping is platform-specific and while this works -on macOS, it has undesirable side-effects on linux. Use GDK_META_MASK -instead which based on my testing seems to do the right thing both on -macOS and linux. ---- - vimode/src/keypress.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/vimode/src/keypress.c b/vimode/src/keypress.c -index 66139a99..525c5ce3 100644 ---- a/vimode/src/keypress.c -+++ b/vimode/src/keypress.c -@@ -26,7 +26,7 @@ KeyPress *kp_from_event_key(GdkEventKey *ev) - KeyPress *kp; - - /* ignore keypresses containing Alt and Command on macOS - no Vim command uses them */ -- if (ev->state & (GDK_MOD1_MASK | GDK_MOD2_MASK)) -+ if (ev->state & (GDK_MOD1_MASK | GDK_META_MASK)) - return NULL; - - switch (ev->keyval) --- -2.31.1 -
Modified: geany_patches/geany_scintilla_block_copy.patch 24 lines changed, 9 insertions(+), 15 deletions(-) =================================================================== @@ -1,19 +1,16 @@ -From 6dcefb6e50f990de716d327a606ee8edfa5c5fad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Techet?= techet@gmail.com -Date: Sat, 25 Mar 2023 00:43:53 +0100 -Subject: [PATCH] Scintilla: replace \0 indicating block copy with \1 +From 31d01326bbe39a8b11d1ab0b0f01fe433288c19c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com +Date: Fri, 24 Mar 2023 22:55:17 +0100 +Subject: Scintilla: replace \0 indicating block copy with \1
This will almost surely include \1 in other applications but at least block copy paste will work within Geany. ---- - scintilla/gtk/ScintillaGTK.cxx | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx -index 659eb7635..424de552f 100644 +index 7a8c4d0b5..717bb3560 100644 --- a/scintilla/gtk/ScintillaGTK.cxx +++ b/scintilla/gtk/ScintillaGTK.cxx -@@ -1399,14 +1399,14 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio +@@ -1520,14 +1520,14 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio return; }
@@ -31,7 +28,7 @@ index 659eb7635..424de552f 100644 #endif
#if PLAT_GTK_WIN32 -@@ -1554,8 +1554,14 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se +@@ -1681,8 +1681,14 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se // All other tested applications behave benignly by ignoring the \0. // The #if is here because on Windows cfColumnSelect clip entry is used // instead as standard indicator of rectangularness (so no need to kludge) @@ -41,20 +38,17 @@ index 659eb7635..424de552f 100644 + // This will probably lead to pasting \1 in other applications but at least + // makes rectangular copy work in Geany. + const char *textData1 = text->Data(); - int len = text->Length(); + gint len = static_cast<gint>(text->Length()); + char *textData = g_strdup(textData1); + textData[len] = '\1'; #if PLAT_GTK_WIN32 == 0 if (text->rectangular) len++; -@@ -1568,6 +1574,7 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se +@@ -1695,6 +1701,7 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se static_cast<GdkAtom>(GDK_SELECTION_TYPE_STRING), 8, reinterpret_cast<const guchar *>(textData), len); } + g_free(textData); }
void ScintillaGTK::StoreOnClipboard(SelectionText *clipText) { --- -2.37.5 -
Modified: geany_patches/geany_vte_login_shell.patch 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -20,7 +20,7 @@ diff --git a/src/keyfile.c b/src/keyfile.c index d4daa0b2f..92d3ac93c 100644 --- a/src/keyfile.c +++ b/src/keyfile.c -@@ -891,13 +891,6 @@ static void load_dialog_prefs(GKeyFile *config) +@@ -980,13 +980,6 @@ static void load_dialog_prefs(GKeyFile *config) struct passwd *pw = getpwuid(getuid()); const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh";
@@ -31,9 +31,9 @@ index d4daa0b2f..92d3ac93c 100644 - shell = "/bin/bash -l"; -#endif - - vc = g_new0(VteConfig, 1); vte_info.dir = utils_get_setting_string(config, "VTE", "last_dir", NULL); if ((vte_info.dir == NULL || utils_str_equal(vte_info.dir, "")) && pw != NULL) + /* last dir is not set, fallback to user's home directory */ diff --git a/src/vte.c b/src/vte.c index ec8c5df37..3b798de40 100644 --- a/src/vte.c @@ -42,7 +42,7 @@ index ec8c5df37..3b798de40 100644
static void vte_start(GtkWidget *widget) { -+ gchar *shell = g_strdup(vc->shell); ++ gchar *shell = g_strdup(vte_config.shell); + +#ifdef __APPLE__ + /* run as a login shell as macOS doesn't load any configuration when @@ -52,7 +52,7 @@ index ec8c5df37..3b798de40 100644 +#endif + /* split the shell command line, so arguments will work too */ -- gchar **argv = g_strsplit(vc->shell, " ", -1); +- gchar **argv = g_strsplit(vte_config.shell, " ", -1); + gchar **argv = g_strsplit(shell, " ", -1);
if (argv != NULL)
Modified: geany_patches/geany_workaround_meson_expecting_git_repository.patch 31 lines changed, 0 insertions(+), 31 deletions(-) =================================================================== @@ -1,31 +0,0 @@ -From e2e19c1519dd10f9c64dbcb42cb42fe2326887a1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Techet?= techet@gmail.com -Date: Mon, 6 Mar 2023 23:22:12 +0100 -Subject: [PATCH] Workaround meson expecting git repository presence - ---- - meson.build | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - -diff --git a/meson.build b/meson.build -index 6944a423b..7b6213870 100644 ---- a/meson.build -+++ b/meson.build -@@ -165,13 +165,7 @@ python = pymod.find_installation('python3', modules: doxygen.found() and get_opt - # These two are truly optional - rst2html = find_program('rst2html', required: get_option('html-docs')) - rst2pdf = find_program('rst2pdf', required: get_option('pdf-docs')) --git = find_program('git', required: false) --if git.found() -- ret = run_command(git, 'rev-parse', '--short', '--revs-only', 'HEAD', check: true) -- cdata.set_quoted('REVISION', ret.stdout().strip()) --else -- cdata.set_quoted('REVISION', '-1') --endif -+cdata.set_quoted('REVISION', '-1') - - python_command = get_option('python-command') - if python_command == '' or python_command == 'auto' --- -2.37.5 -
Modified: geany_patches/git-geany_config_shell.patch 254 lines changed, 0 insertions(+), 254 deletions(-) =================================================================== @@ -1,254 +0,0 @@ -From 2981b0761b343e0eb49ab36f01bf37c4acec5245 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Sat, 9 Nov 2019 10:46:39 -0800 -Subject: [PATCH 1/2] Allow configuring shell used for build commands - -Currently there is a problem when users use a different shell than sh/bash -and configure their environment in the config file of the given shell. -This config file isn't loaded by Geany because Geany always uses sh -in a non-login non-interactive way. - -This patch tries to solve the problem by allowing users to specify the -shell they want to use for launching build commands. In order to make -shells load their config files, the shells are run as login non-interactive -shells because non-login non-interactive shells like sh/bash don't load -configuration from any files. Unfortunately csh/tcsh don't allow us to be -run as login and use the -c option simultaneously so these shells aren't -started as login shells. - -Running shells as login is absolutely necessary on macOS even for sh/bash. -While on linux display managers typically source .profile upon login, -this doesn't happen on macOS and the only way to get the environment loaded -is to run shells as login. - -There are some places where /bin/sh can still be used. One of them is -the execute command. When configured to use VTE for execution, we already -have the environment set up by the shell in VTE so we don't need to do any -other work. When configured to use external terminal for running, the -terminal is run as non-login interactive so it should load its -configuration too. - -I kept the printing command to use /bin/sh because either the code used -for the build command would have to be duplicated there or somehow -factored-out and it doesn't seem to be worth the work for this simple -case where only /usr/bin/lpr is called. - -This patch has been tested with the following shells: -sh, bash, dash, ksh, zsh, csh, tcsh, fish, ion ---- - data/geany.glade | 59 +++++++++++++++++++++++++++++++++++++++++++++++- - src/build.c | 14 ++++++++++-- - src/keyfile.c | 7 ++++++ - src/prefs.c | 10 ++++++++ - src/prefs.h | 1 + - 5 files changed, 88 insertions(+), 3 deletions(-) - -diff --git a/data/geany.glade b/data/geany.glade -index 3864a0ad1..79cf7c4b9 100644 ---- a/data/geany.glade -+++ b/data/geany.glade -@@ -4798,7 +4798,7 @@ - <object class="GtkTable" id="table1"> - <property name="visible">True</property> - <property name="can-focus">False</property> -- <property name="n-rows">3</property> -+ <property name="n-rows">4</property> - <property name="n-columns">3</property> - <property name="column-spacing">6</property> - <property name="row-spacing">3</property> -@@ -4960,6 +4960,63 @@ - <property name="y-options"/> - </packing> - </child> -+ <child> -+ <object class="GtkLabel" id="label27"> -+ <property name="visible">True</property> -+ <property name="can-focus">False</property> -+ <property name="xalign">0</property> -+ <property name="label" translatable="yes">Shell:</property> -+ <property name="mnemonic-widget">entry_grep</property> -+ </object> -+ <packing> -+ <property name="top-attach">3</property> -+ <property name="bottom-attach">4</property> -+ <property name="x-options">GTK_FILL</property> -+ <property name="y-options"/> -+ </packing> -+ </child> -+ <child> -+ <object class="GtkEntry" id="entry_shell1"> -+ <property name="visible">True</property> -+ <property name="can-focus">True</property> -+ <property name="tooltip-text" translatable="yes">Shell used for build commands (useful to get environment set up from the shell's config files)</property> -+ <property name="invisible-char">•</property> -+ <property name="invisible-char-set">True</property> -+ <property name="primary-icon-activatable">False</property> -+ <property name="secondary-icon-activatable">False</property> -+ <property name="primary-icon-sensitive">True</property> -+ <property name="secondary-icon-sensitive">True</property> -+ </object> -+ <packing> -+ <property name="left-attach">1</property> -+ <property name="right-attach">2</property> -+ <property name="top-attach">3</property> -+ <property name="bottom-attach">4</property> -+ <property name="y-options"/> -+ </packing> -+ </child> -+ <child> -+ <object class="GtkButton" id="button_shell"> -+ <property name="visible">True</property> -+ <property name="can-focus">True</property> -+ <property name="receives-default">False</property> -+ <child> -+ <object class="GtkImage" id="image777X"> -+ <property name="visible">True</property> -+ <property name="can-focus">False</property> -+ <property name="stock">gtk-open</property> -+ </object> -+ </child> -+ </object> -+ <packing> -+ <property name="left-attach">2</property> -+ <property name="right-attach">3</property> -+ <property name="top-attach">3</property> -+ <property name="bottom-attach">4</property> -+ <property name="x-options">GTK_FILL</property> -+ <property name="y-options"/> -+ </packing> -+ </child> - </object> - <packing> - <property name="expand">False</property> -diff --git a/src/build.c b/src/build.c -index 4c9f4ebb2..996758d80 100644 ---- a/src/build.c -+++ b/src/build.c -@@ -772,10 +772,11 @@ static gchar *build_replace_placeholder(const GeanyDocument *doc, const gchar *s - static void build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *dir) - { - GError *error = NULL; -- gchar *argv[] = { "/bin/sh", "-c", NULL, NULL }; -+ gchar *argv[] = { tool_prefs.shell_cmd, "-l", "-c", NULL, NULL }; - gchar *working_dir; - gchar *utf8_working_dir; - gchar *cmd_string; -+ gchar *shell = NULL; - - g_return_if_fail(doc == NULL || doc->is_valid); - -@@ -799,8 +800,16 @@ static void build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d - - #ifdef G_OS_UNIX - cmd_string = utils_get_locale_from_utf8(cmd); -- argv[2] = cmd_string; - cmd = NULL; /* under Unix, use argv to start cmd via sh for compatibility */ -+ shell = g_path_get_basename(tool_prefs.shell_cmd); -+ if (g_strcmp0(shell, "csh") == 0 || g_strcmp0(shell, "tcsh") == 0) -+ { -+ /* csh and tcsh don't support -l together with -c so don't use it */ -+ argv[1] = "-c"; -+ argv[2] = cmd_string; -+ } -+ else -+ argv[3] = cmd_string; - #else - /* Expand environment variables like %blah%. */ - cmd_string = win32_expand_environment_variables(cmd); -@@ -825,6 +834,7 @@ static void build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d - - g_free(working_dir); - g_free(cmd_string); -+ g_free(shell); - } - - -diff --git a/src/keyfile.c b/src/keyfile.c -index a5f6e9dfd..d4daa0b2f 100644 ---- a/src/keyfile.c -+++ b/src/keyfile.c -@@ -93,6 +93,11 @@ - #endif - #define GEANY_DEFAULT_TOOLS_PRINTCMD "lpr" - #define GEANY_DEFAULT_TOOLS_GREP "grep" -+#ifdef __APPLE__ -+# define GEANY_DEFAULT_TOOLS_SHELL "/bin/bash" -+#else -+# define GEANY_DEFAULT_TOOLS_SHELL "/bin/sh" -+#endif - #define GEANY_DEFAULT_MRU_LENGTH 10 - #define GEANY_TOGGLE_MARK "~ " - #define GEANY_MAX_AUTOCOMPLETE_WORDS 30 -@@ -523,6 +528,7 @@ static void save_dialog_prefs(GKeyFile *config) - g_key_file_set_string(config, "tools", "terminal_cmd", tool_prefs.term_cmd ? tool_prefs.term_cmd : ""); - g_key_file_set_string(config, "tools", "browser_cmd", tool_prefs.browser_cmd ? tool_prefs.browser_cmd : ""); - g_key_file_set_string(config, "tools", "grep_cmd", tool_prefs.grep_cmd ? tool_prefs.grep_cmd : ""); -+ g_key_file_set_string(config, "tools", "shell_cmd", tool_prefs.shell_cmd ? tool_prefs.shell_cmd : ""); - g_key_file_set_string(config, PACKAGE, "context_action_cmd", tool_prefs.context_action_cmd); - - /* build menu */ -@@ -965,6 +971,7 @@ static void load_dialog_prefs(GKeyFile *config) - tool_prefs.term_cmd = cmd; - tool_prefs.browser_cmd = utils_get_setting_string(config, "tools", "browser_cmd", GEANY_DEFAULT_TOOLS_BROWSER); - tool_prefs.grep_cmd = utils_get_setting_string(config, "tools", "grep_cmd", GEANY_DEFAULT_TOOLS_GREP); -+ tool_prefs.shell_cmd = utils_get_setting_string(config, "tools", "shell_cmd", GEANY_DEFAULT_TOOLS_SHELL); - - tool_prefs.context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", ""); - -diff --git a/src/prefs.c b/src/prefs.c -index 5d1b5fc97..f43f83619 100644 ---- a/src/prefs.c -+++ b/src/prefs.c -@@ -683,6 +683,8 @@ static void prefs_init_dialog(void) - if (tool_prefs.grep_cmd) - gtk_entry_set_text(GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_grep")), tool_prefs.grep_cmd); - -+ if (tool_prefs.shell_cmd) -+ gtk_entry_set_text(GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_shell1")), tool_prefs.shell_cmd); - - /* Template settings */ - widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_template_developer"); -@@ -1160,6 +1162,9 @@ on_prefs_dialog_response(GtkDialog *dialog, gint response, gpointer user_data) - g_free(tool_prefs.grep_cmd); - tool_prefs.grep_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); - -+ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_shell1"); -+ g_free(tool_prefs.shell_cmd); -+ tool_prefs.shell_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); - - /* Template settings */ - widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_template_developer"); -@@ -1727,6 +1732,7 @@ void prefs_show_dialog(void) - "entry_com_term", - "entry_browser", - "entry_grep", -+ "entry_shell1", - "entry_contextaction", - "entry_template_developer", - "entry_template_initial", -@@ -1787,6 +1793,10 @@ void prefs_show_dialog(void) - NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_grep"))); -+ ui_setup_open_button_callback(ui_lookup_widget(ui_widgets.prefs_dialog, "button_shell"), -+ NULL, -+ GTK_FILE_CHOOSER_ACTION_OPEN, -+ GTK_ENTRY(ui_lookup_widget(ui_widgets.prefs_dialog, "entry_shell1"))); - - /* tools commands */ - ui_setup_open_button_callback(ui_lookup_widget(ui_widgets.prefs_dialog, "button_contextaction"), -diff --git a/src/prefs.h b/src/prefs.h -index dcf33a502..aedfcb0f8 100644 ---- a/src/prefs.h -+++ b/src/prefs.h -@@ -49,6 +49,7 @@ typedef struct GeanyToolPrefs - gchar *term_cmd; /**< terminal emulator command */ - gchar *grep_cmd; /**< grep command */ - gchar *context_action_cmd; /**< context action command */ -+ gchar *shell_cmd; /**< shell used for running commands */ - } - GeanyToolPrefs; - --- -2.17.1 -
Modified: geany_patches/git-geany_scintilla_block_copy.patch 54 lines changed, 0 insertions(+), 54 deletions(-) =================================================================== @@ -1,54 +0,0 @@ -From 31d01326bbe39a8b11d1ab0b0f01fe433288c19c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Fri, 24 Mar 2023 22:55:17 +0100 -Subject: Scintilla: replace \0 indicating block copy with \1 - -This will almost surely include \1 in other applications but at least -block copy paste will work within Geany. - -diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx -index 7a8c4d0b5..717bb3560 100644 ---- a/scintilla/gtk/ScintillaGTK.cxx -+++ b/scintilla/gtk/ScintillaGTK.cxx -@@ -1520,14 +1520,14 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio - return; - } - -- // Check for "\n\0" ending to string indicating that selection is rectangular -+ // Check for "\n\1" ending to string indicating that selection is rectangular - bool isRectangular; - #if PLAT_GTK_WIN32 - isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; - #else -- isRectangular = ((len > 2) && (data[len - 1] == 0 && data[len - 2] == '\n')); -+ isRectangular = ((len > 2) && (data[len - 1] == 1 && data[len - 2] == '\n')); - if (isRectangular) -- len--; // Forget the extra '\0' -+ len--; // Forget the extra '\1' - #endif - - #if PLAT_GTK_WIN32 -@@ -1681,8 +1681,14 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se - // All other tested applications behave benignly by ignoring the \0. - // The #if is here because on Windows cfColumnSelect clip entry is used - // instead as standard indicator of rectangularness (so no need to kludge) -- const char *textData = text->Data(); -+ -+ // Jiri Techet: Even more evil thing: \0 is dropped by macOS so let's use \1. -+ // This will probably lead to pasting \1 in other applications but at least -+ // makes rectangular copy work in Geany. -+ const char *textData1 = text->Data(); - gint len = static_cast<gint>(text->Length()); -+ char *textData = g_strdup(textData1); -+ textData[len] = '\1'; - #if PLAT_GTK_WIN32 == 0 - if (text->rectangular) - len++; -@@ -1695,6 +1701,7 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se - static_cast<GdkAtom>(GDK_SELECTION_TYPE_STRING), - 8, reinterpret_cast<const guchar *>(textData), len); - } -+ g_free(textData); - } - - void ScintillaGTK::StoreOnClipboard(SelectionText *clipText) {
Modified: geany_patches/git-geany_vte_login_shell.patch 70 lines changed, 0 insertions(+), 70 deletions(-) =================================================================== @@ -1,70 +0,0 @@ -From 11ae19d0df6bf5715c1a92f9b1f5f5fe07621174 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= techet@gmail.com -Date: Sat, 9 Nov 2019 11:07:19 -0800 -Subject: [PATCH 2/2] Make sure any shell used in VTE is run as login shell on - macOS - -Previously we did this for bash only but we should do it for arbitrary -shell. The -l option seems to be supported by all major shells. - -Previously we used to add -l to the settings value itself which probably -isn't the cleanest way as the entry should contain path. Let's add -it invisibly to user but make sure we don't add it when settings already -contains -l. ---- - src/keyfile.c | 7 ------- - src/vte.c | 12 +++++++++++- - 2 files changed, 11 insertions(+), 8 deletions(-) - -diff --git a/src/keyfile.c b/src/keyfile.c -index d4daa0b2f..92d3ac93c 100644 ---- a/src/keyfile.c -+++ b/src/keyfile.c -@@ -980,13 +980,6 @@ static void load_dialog_prefs(GKeyFile *config) - struct passwd *pw = getpwuid(getuid()); - const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh"; - --#ifdef __APPLE__ -- /* Geany is started using launchd on OS X and we don't get any environment variables -- * so PS1 isn't defined. Start as a login shell to read the corresponding config files. */ -- if (strcmp(shell, "/bin/bash") == 0) -- shell = "/bin/bash -l"; --#endif -- - vte_info.dir = utils_get_setting_string(config, "VTE", "last_dir", NULL); - if ((vte_info.dir == NULL || utils_str_equal(vte_info.dir, "")) && pw != NULL) - /* last dir is not set, fallback to user's home directory */ -diff --git a/src/vte.c b/src/vte.c -index ec8c5df37..3b798de40 100644 ---- a/src/vte.c -+++ b/src/vte.c -@@ -485,8 +485,17 @@ static void vte_commit_cb(VteTerminal *vte, gchar *arg1, guint arg2, gpointer us - - static void vte_start(GtkWidget *widget) - { -+ gchar *shell = g_strdup(vte_config.shell); -+ -+#ifdef __APPLE__ -+ /* run as a login shell as macOS doesn't load any configuration when -+ * user is logged in and this is the only way to load config files */ -+ if (strstr(shell, " -l") == NULL) -+ SETPTR(shell, g_strconcat(shell, " -l", NULL)); -+#endif -+ - /* split the shell command line, so arguments will work too */ -- gchar **argv = g_strsplit(vte_config.shell, " ", -1); -+ gchar **argv = g_strsplit(shell, " ", -1); - - if (argv != NULL) - { -@@ -513,6 +522,7 @@ static void vte_start(GtkWidget *widget) - pid = 0; /* use 0 as invalid pid */ - - set_clean(TRUE); -+ g_free(shell); - } - - --- -2.17.1 -
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).