This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
electric-tads-brace misbehaves #6
Comments
I'm not seeing this behaviour. Do you have |
Ohhhh, I'll check on that. I'd removed that behavior entirely to make it more usable in the meantime but I can put it back. |
Yup, it was a conflict with smartparens. I'm going to see if I can figure out how to modify the function so that it is compatible with smartparens being on. |
Alright, I managed to get a (possibly simpleminded) prototype implementation of electric braces going that works with and without smartparens enabled. Here it is: (defun electric-tads3-brace (arg)
"Insert character and correct line's indentation."
(interactive "P")
(let (insertpos)
(if (and tads3-auto-newline
(not (save-excursion
(skip-chars-backward " \t")
(bolp))))
(progn
(tads3-indent-line)
(newline)))
(self-insert-command (prefix-numeric-value arg))
(tads3-indent-line)
(newline)
(save-excursion
(newline)
(tads3-indent-line))
(tads3-indent-line))) |
I kept insertpos around bc if I need to expand this later to add some of the logic back, it might be needed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When entering an open curly brace, it puts the cursor outside of the braces instead of inside when auto-newline is enabled.
The text was updated successfully, but these errors were encountered: