|
From: | Wilhelm Kirschbaum |
Subject: | bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just like python |
Date: | Tue, 04 Apr 2023 21:46:47 +0200 |
User-agent: | mu4e 1.9.3; emacs 30.0.50 |
On Tue, Apr 4, 2023 at 7:12 PM Wilhelm Kirschbaum <wkirschbaum@gmail.com> wrote:The custom psif is not for the newline, but for pairing up the triple quotes `"""` with another set of tripe quotes when electric-pair-mode isenabled. The newline is for keeping the syntax valid in elixir, otherwise the font and navigation breaks because `""""""` is notvalidElixir syntax and the tree-sitter grammar really does not like it.I see. My apologies for not having noticed this in the preceding emails. If you want some kind of electricity so that typing thethird `"` results in two `"` and a newline getting added, then that is completely new and probably does require a custom psif.
Just to clarify on the desired behaviour: With `|` is (point):When typing the first quote `"|` it pairs to be `"|"` as single quote strings are valid in Elixir. Then when typing the second `"` it skips the second quote `""|`, now when typing the third quote `""|"` it pairs the heredoc: `"""|"""` and with electric-layout it will now insert the
newlines: `"""\n|\n"""`. This means, as the original report, the user can type`@doc """|` and will correctly jump into the heredoc and tree-sitter
grammar will stay valid. @doc """ | """ There is no scenario in Elixir I can thin of where this is not the desired behaviour.
[Prev in Thread] | Current Thread | [Next in Thread] |