rustic icon indicating copy to clipboard operation
rustic copied to clipboard

Disabling auto braces

Open 949f45ac opened this issue 2 years ago • 2 comments

Hello, I enjoy using this project very much, there is just one issue. (Recently?) I started to receive automatically inserted closing braces when I add an opening brace somewhere in my code. I would like to disable this behaviour (ANY automatically inserted characters confuse me immensely), but I could not figure out how to do it and/or which component of rustic precisely is at fault. Thankful for any pointers

949f45ac avatar Dec 13 '23 08:12 949f45ac

This could be an LSP rather than Rustic thing, because I get the same behaviour on vanilla rust-mode with eglot.

appetrosyan avatar Jan 31 '24 20:01 appetrosyan

You should try setting lsp-enable-on-type-formatting to nil. This is a rust-analyzer bug (cf: https://github.com/rust-lang/rust-analyzer/issues/16084 for more info). The latter post is suggesting to run the function (lsp-toggle-on-type-formatting), which drives the former variable and do some upkeeping of hooks after toggling the variable's value. I had more success with nil in the variable at rustic setup time.

vaab avatar Jul 25 '24 15:07 vaab