Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume closing brackets, braces, parenthesis, single and double quotes #2122

Closed
wants to merge 0 commits into from

Conversation

jeremiaskleer
Copy link

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.

Copy link
Member

@elextr elextr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I didn't know and in first place it was not obvious to me

return 0;

case SCI_DELETECHAR:
pdoc->DelChar(static_cast<Sci::Position>(wParam));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you add this? Why not just use DELETERANGE with length 1?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, same as before. Didn't know it.

@codebrainz
Copy link
Member

Have you tried the autoclose plugin?

@jeremiaskleer
Copy link
Author

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
Copy link
Author

Have you tried the autoclose plugin?

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.

doc/geany.txt Outdated
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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#.

@elextr
Copy link
Member

elextr commented Apr 12, 2019

@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.

@codebrainz
Copy link
Member

codebrainz commented Apr 13, 2019

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
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants