-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Emacs: Add electric-pair-mode support for triple-quoted strings #8570
Conversation
CT Test Results 2 files 22 suites 6m 7s ⏱️ Results for commit 36a35ce. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Shouldn't we add a newline before closing """ as well? |
@aathn ping |
We could -- I suppose it's a matter of personal taste. In languages with brace-enclosed blocks |
I do think I want that in this case since it is required, I see that as a remainder and education, also it is a new feature Can you add it please. |
Done. Now it works as follows:
Does that look okay? |
Thanks |
This adds support for automatically inserting the closing delimiter for triple-quoted string literals in the Emacs mode.
If
erlang-mode
andelectric-pair-mode
are enabled, it works as follows, if|
is the cursor position and a double quote is inserted.This is accomplished by adding a function to
post-self-insert-hook
checking wheneverelectric-pair-mode
is enabled and a third double quote is inserted, and then inserting three more. The approach is taken frompython.el
, which has the same feature for Python's triple-quote strings.