Skip to content

String quote in multi-line @doc interfering with prettify-symbols-mode #42

@bunnylushington

Description

@bunnylushington

An unterminated single or double quote inside a multi-line @doc construct will inhibit prettify-symbols-mode from functioning correctly. The function prettify-symbols-default-compose-p is specific about when it's willing to prettify a symbol and it appears that the syntax class of the character preceding the symbol is incorrect.

With the simple configuration

(push '("|>" . "▷") prettify-symbols-alist)

we get

@doc """
documentation is here
"""
def test do
  :an_atom
  ▷ IO.inspect
end

@doc """
here's the error, note the apostrophe
"""
def test_2 do
  :an_atom
  |> IO.inspect
end

Single line comments don't trigger the issue. A lone double quote will. Matched quotes of either sort will not.

Not, obviously, a serious or pressing issue! I happen to use a lot of contractions in my docs and noticed the behavior though I'm stumped how best to address it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions