How to turn off autocompletion of brackets?

Solved bugs are moved into this topic...
Post Reply
IBon
Posts: 5
Joined: 21.12.2020 15:57

How to turn off autocompletion of brackets?

Post by IBon »

Thank you for a very nice text editor!

I would like to turn off autocompletion of ending brackets in JavaScript ( ) { } [ ] , since I find it annoying and would like to set brackets myself.

Please tell me how to do this?

Best regards
Iwan
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

I think you are looking for option "auto_close_brackets"
in Plugins > Options Editor
Check "For Lexer", choose "Javascript" and put empty string in "User" value.
IBon
Posts: 5
Joined: 21.12.2020 15:57

Post by IBon »

Thank you for the advice.

I tried that but it didn't work :(

When you write "empty string" do you mean with a RegEx expression perhaps? Like \s{1}?
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

IBon wrote:When you write "empty string" do you mean with a RegEx expression perhaps? Like \s{1}?
Press enter on empty field. You will have a "lexer JavaScript.json" file in "cudatext/settings" folder that will look something like this

Code: Select all

{
    "auto_close_brackets": "",
}
Just ckecked again, it works for me, maybe try restarting Cudatext.
(A little caveat: it disables bracket auto closing in all lexers :) , maybe Alexey will clarify this)
IBon
Posts: 5
Joined: 21.12.2020 15:57

Post by IBon »

Now it works, thank you so much! :D

I just didn't know I was supposed to press "enter" afterwards.
uvviewsoft_
Posts: 17
Joined: 27.12.2020 08:31

Post by uvviewsoft_ »

>(A little caveat: it disables bracket auto closing in all lexers :) , maybe Alexey will clarify this)

do you have option in "lexer JavaScript.json" and it disables bracket completion in C++ lexer?
steps to repeat, pls?
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

uvviewsoft_ wrote:steps to repeat, pls?
On fresh install:
Added ' "auto_close_brackets": "" ' to 'lexer JavaScript.json'
Restart.
When .c and .js files opened:
* first brackets autoclose in .c (expected)
* then switch to .js - doesn't autoclose (expected)
* switch back to .c - doesn't autoclose (weird)

edit: on version cudatext-linux-gtk2-amd64-1.118.2.0.tar.xz
uvviewsoft_
Posts: 17
Joined: 27.12.2020 08:31

Post by uvviewsoft_ »

i confirm this, it's a bug, to-fix.
https://github.com/Alexey-T/CudaText/issues/2980
uvviewsoft_
Posts: 17
Joined: 27.12.2020 08:31

Post by uvviewsoft_ »

it was easy to fix it, will be OK in 1.118.5.
uvviewsoft_
Posts: 17
Joined: 27.12.2020 08:31

Post by uvviewsoft_ »

made the same fix for almost all autocomplete_* options. they were coded the same way.
Post Reply