Skip to content

show-paren-mode highlights irrelevant things for some expressions #97

Closed
@rrudakov

Description

@rrudakov

For treesitter major modes, show-paren-data-function is set to treesit-show-paren-data by default. This function highlights the first and the last children of a list "thing", which is not always matching pairs. For example:

  • Function literals:
Image
  • Sets:
Image
  • Expressions with metadata (BTW, I really don't like how the grammar works with metadata, it's pain to work with and causes more problems than benefits):
Image
Image

I can implement a custom show-paren-data-function for clojure-ts-mode that will always highlight matching pairs. In this case navigation might look inconsistent, because an opening paren is somewhere in the middle of a node. For example from this position:

Image

executing backward-sexp would bring cursor to this position:

Image

because the vector apparently starts from ^.

Would this change be an improvement? Or we better keep the existing behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions