bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62536: 30.0.50; Can we add """ ... """ electric pair in elixir, just


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 is
enabled. The newline is for keeping the syntax valid in elixir, otherwise the font and navigation breaks because `""""""` is not
valid
Elixir 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 the
third `"` 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.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]