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

Auto complete braces unwanted behavior #634

Closed
kminchev opened this issue Mar 12, 2023 · 9 comments
Closed

Auto complete braces unwanted behavior #634

kminchev opened this issue Mar 12, 2023 · 9 comments

Comments

@kminchev
Copy link

kminchev commented Mar 12, 2023

I have everything under Settings > Auto Completion Settings > Auto Complete braces and quotes unchecked, but when I type ( or any other type of brace or quote over a selection of text it gets auto-completed by ) even it the setting for that isn't enabled.

I'd expect it to overwrite the selection with (.

@zufuliu
Copy link
Owner

zufuliu commented Mar 13, 2023

The behavior of (selection) is not configurable currently, see https://github.com/zufuliu/notepad2/wiki/Auto-Completion-in-Notepad2#auto-complete-braces-and-quotes.

@kminchev
Copy link
Author

So is this intended behavior or you're looking for a workaround? I hope it's not intended, because virtually every editor I know of overwrites the selection when you type anything on it.

@kminchev kminchev changed the title Auto complete braces unwanted behaviour Auto complete braces unwanted behavior Mar 13, 2023
@zufuliu
Copy link
Owner

zufuliu commented Mar 14, 2023

The behavior (enclose instead of overwrite selection) is borrowed from other editors, e.g. VS Code, Visual Studio, Sublime Text, CodeWarrior, etc.

Add (or reuse current AutoInsertMask) option to configure it would be good.

@zufuliu
Copy link
Owner

zufuliu commented Mar 24, 2023

The configuration should works after 0682602, feel free to test latest builds from https://github.com/zufuliu/notepad2/actions/runs/4510000510.

@kminchev
Copy link
Author

Works great! Thanks for the update!

Looking forward to the release ;)

@zufuliu zufuliu closed this as completed Mar 24, 2023
@kminchev
Copy link
Author

Unfortunately, I have to re-report this after the latest release - when you type ( and hit Enter the new line is indented.

@zufuliu
Copy link
Owner

zufuliu commented Apr 18, 2023

when you type ( and hit Enter the new line is indented.

That's configured by "Auto indent text" option.

@zufuliu
Copy link
Owner

zufuliu commented Apr 18, 2023

Relevant code is following, probably it should omit [ and (:
https://github.com/zufuliu/notepad2/blob/09ee0dd61513e065fb7e6ab33963ac1e816780ce/src/EditAutoC.c#L2164-L2170

@kminchev
Copy link
Author

Thanks! Wasn't aware of the Auto Indent Text option.

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

No branches or pull requests

2 participants