For a fluent coding I love to not change my hand position to use the arrow keys! I realy like auto-closing.
If I activate the auto closing brackets, braces, parenthesis and quotes feature, the closing characters are inserted, but to continue after these, the arrow keys are necessary.
The modification I made: if autoclosing AND consuming is activated in options, if a closing character is typed and the following character matches this, not both characters stay - one deleted - curr pos afterwards.
Example: the | marks the curr position:
"|" "hallo|" [Then the " is hit] "hallo"|
The " is reachable without changing hand pos. Same for the other "autoclosers".
I saw this in other IDEs and I want it in my Geany.
I don't know about internationatlization, so this is an incomplete feature. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2122
-- Commit Summary --
* Consume closing brackets, braces, parenthesis, single and double quotes
-- File Changes --
M data/geany.glade (239) M scintilla/include/Scintilla.h (1) M scintilla/src/Editor.cxx (5) M src/editor.c (67) M src/editor.h (1) M src/keyfile.c (2) M src/prefs.c (43) M src/sciwrappers.c (9) M src/sciwrappers.h (3)
-- Patch Links --
https://github.com/geany/geany/pull/2122.patch https://github.com/geany/geany/pull/2122.diff
elextr requested changes on this pull request.
Please update the manual as well.
Did you use glade 3.8.5/6 to update geany.glade?
@@ -49,6 +49,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_CHANGEINSERTION 2672 #define SCI_CLEARALL 2004 #define SCI_DELETERANGE 2645 +#define SCI_DELETECHAR 2719
Anything in the scintilla directory comes from upstream, it will be overwritten next time its updated from upstream, so you need to get the changes into upstream.
return 0;
+ + case SCI_DELETECHAR: + pdoc->DelChar(static_castSci::Position(wParam));
Also from upstream.
@@ -227,6 +227,15 @@ void sci_add_text(ScintillaObject *sci, const gchar *text)
} }
+void sci_delete_char(ScintillaObject *sci, const gint pos) +{ + SSM(sci, SCI_DELETECHAR, pos, 0);
why did you add this? Why not just use DELETERANGE with length 1?
Have you tried the [autoclose plugin](https://plugins.geany.org/autoclose.html)?
@jeremiaskleer pushed 1 commit.
aeb58c997bcc5747b02db18b9b28b55620b25f18 Consume closing brackets, braces, parenthesis, single and double quotes
Please update the manual as well.
Did you use glade 3.8.5/6 to update geany.glade?
Ok, I will
I edited it as a textfile since my glade is 3.22. I didn't want to break anything and switching to an older glade was not in my scope
jeremiaskleer commented on this pull request.
@@ -49,6 +49,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_CHANGEINSERTION 2672 #define SCI_CLEARALL 2004 #define SCI_DELETERANGE 2645 +#define SCI_DELETECHAR 2719
Ok. I didn't know and in first place it was not obvious to me
jeremiaskleer commented on this pull request.
@@ -227,6 +227,15 @@ void sci_add_text(ScintillaObject *sci, const gchar *text)
} }
+void sci_delete_char(ScintillaObject *sci, const gint pos) +{ + SSM(sci, SCI_DELETECHAR, pos, 0);
Yeah, same as before. Didn't know it.
Have you tried the [autoclose plugin](https://plugins.geany.org/autoclose.html)?
No, I didn't. But now I see this does it very well. But on the other hand it was a little change that in my opinion repairs the autoclose in geany.
@jeremiaskleer pushed 1 commit.
9faa879cfbfbc34b9f0b5029e2a55640dc792e66 Consume closing brackets, braces, parenthesis, single and double quotes
elextr commented on this pull request.
@@ -2246,6 +2246,10 @@ Single quotes ' '
Double quotes " " Auto-close double quotes when typing an opening one
+For a more fluent writing one can also activate that Geany checks if the
Not sure "fluent" will be correctly understood, maybe just say to avoid having to move your typing hand off the keyboard to the arrow keys as you explained in the issue description.
And apparently "Fluent" is a type of coding paradigm in C#.
@jeremiaskleer its the normal policy of Geany to not accept hand edits to `geany.glade` because they tend to cause Glade to make many unrelated changes the next time its used. One of the Geany contributors even made changes to Glade to minimise the changes it makes, but that only works when its reading a file it wrote IIUC.
And yes I _totally_ agree with you about needing to compile your own Glade 3.8.5 or 3.8.6, I won't either, but until support for GTK2 is removed from Geany, the Glade version can't be advanced to one thats available in repositories.
But since the functionality is available in the "autoclose" plugin there may not be much incentive to add this, but lets see if anybody tests it and reports its working.
And yes I totally agree with you about needing to compile your own Glade 3.8.5 or 3.8.6
It's even easier to compile than Geany.
but until support for GTK2 is removed from Geany, the Glade version can't be advanced to one thats available in repositories
That's not true, if we advance the Glade version, it will still be stuck at a different version, which is unlikely to be the same version as found in <your distro> repositories. It has nothing to do with GTK+ version but rather that the output from Glade is unstable, even between minor versions.
@jeremiaskleer pushed 1 commit.
3ae1885a16c7ae01039c2de2ec39bc6aaca0a312 Consume closing brackets, braces, parenthesis, single and double quotes
@jeremiaskleer pushed 2 commits.
3a7f0c9e32ea5bb08a86a731328ba329983388f0 Fix loading the default open encoding option fdbd068fcb80dfbbf090b956f1f440eb3230bbfb Small update of German translation
@jeremiaskleer its the normal policy of Geany to not accept hand edits to `geany.glade` because they tend to cause Glade to make many unrelated changes the next time its used. One of the Geany contributors even made changes to Glade to minimise the changes it makes, but that only works when its reading a file it wrote IIUC.
And yes I _totally_ agree with you about needing to compile your own Glade 3.8.5 or 3.8.6, I won't either, but until support for GTK2 is removed from Geany, the Glade version can't be advanced to one thats available in repositories.
But since the functionality is available in the "autoclose" plugin there may not be much incentive to add this, but lets see if anybody tests it and reports its working.
I tried compiling glade 3.8.6 with no success within 1 hour. I stopped. Maybe someone already having glade in correct version could help.
I don't agree with the last point: I see no reason for not fixing a feature in Geany, in my opinion not usable, because it can be circumvented with a plugin, although there is a easy fix, already prepared. Of course I am biased as I invested hours in understanding, fixing, and preparing a fix. I love Geany, I use it in on every computer I run. I circumvent enterprise firewalls and software policies just to install Geany to use it everyday. For a while I was compiling and preparing ubuntu-packages and providing them in a repository when Geany in the official repositories where behind the current development.
@jeremiaskleer pushed 2 commits.
27afe31cce1cbb9eab86081351e2bf09fcb11ed4 Fix lost coloring 086c2f5842b58e81a7c38b20552eac760ef010d0 Merge branch 'master' of github.com:geany/geany
@jeremiaskleer pushed 1 commit.
56248d7c379103d7f5dd38a4d0b79dd5e961c99d Autoclose and nice bracket handling
@jeremiaskleer pushed 1 commit.
9ac4f003addc3ce74a4a24ef6fb3008e8b2ea5a3 working on nice bracket handling
@jeremiaskleer pushed 1 commit.
4862eb2d82188bc5b2f0e550be5ae7e3cc651cf5 working on nice bracket handiling on new line
@jeremiaskleer pushed 1 commit.
ca940f4ad5f3e86c1212eca9d09a63fb6d9e368e working on nice bracket on new line handling
@jeremiaskleer pushed 1 commit.
380f5f4ed8a025fca75e4bab1a80cd636f672be2 Finished nice bracket handling on new line
Closed #2122.
github-comments@lists.geany.org