Skip to content

Commit

Permalink
fix(meow-next-thing): allow no include-syntax (#689)
Browse files Browse the repository at this point in the history
With the addition of `meow-next-thing-include-syntax` (13733e1),
`meow--fix-thing-selection-mark` expects to find an entry in this alist
corresponding to `thing`. This means that when the user defines their
own `thing` and sets `meow-word-thing` or `meow-symbol-thing` to use it,
they also need to add a corresponding entry to this alist.

I'll admit that I don't understand why the `include-syntax` option
needed to be introduced in `meow--fix-thing-selection-mark` (c0878ac).
However, my own definitions of `meow-word-thing` and `meow-symbol-thing`
worked fine without it. Based on that, my logic in this commit is that
users shouldn't have to add to `meow-next-thing-include-syntax` unless
they explicitly need the `skip-syntax-*` shrinking that was added to
`meow--fix-thing-selection-mark`.

Co-authored-by: 45mg <[email protected]>
  • Loading branch information
45mg and 45mg authored Dec 6, 2024
1 parent 49bfe25 commit 73f2dd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,9 @@ If N is negative, select to the beginning of the previous Nth thing instead."
(meow--cancel-selection))
(unless include-syntax
(setq include-syntax
(let ((thing-include-syntax (alist-get thing meow-next-thing-include-syntax)))
(let ((thing-include-syntax
(or (alist-get thing meow-next-thing-include-syntax)
'("" ""))))
(if (> n 0)
(car thing-include-syntax)
(cadr thing-include-syntax)))))
Expand Down

0 comments on commit 73f2dd2

Please sign in to comment.