Skip to content

Commit

Permalink
Add meow-next-thing-include-syntax option.
Browse files Browse the repository at this point in the history
  • Loading branch information
DogLooksGood committed Nov 3, 2024
1 parent 2c7f69b commit 13733e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 8 additions & 3 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,12 @@ those in INCLUDE-SYNTAX."
If N is negative, select to the beginning of the previous Nth thing instead."
(unless (equal type (cdr (meow--selection-type)))
(meow--cancel-selection))
(unless include-syntax (setq include-syntax "'w_ "))
(unless include-syntax
(setq include-syntax
(let ((thing-include-syntax (alist-get thing meow-next-thing-include-syntax)))
(if (> n 0)
(car thing-include-syntax)
(cadr thing-include-syntax)))))
(let* ((expand (equal (cons 'expand type) (meow--selection-type)))
(_ (when expand
(if (< n 0) (meow--direction-backward)
Expand Down Expand Up @@ -946,15 +951,15 @@ To select continuous symbols, use following approaches:
A non-expandable word selection will be created.
This command works similar to `meow-next-word'."
(interactive "p")
(meow-next-thing meow-word-thing 'word (- n) "_w "))
(meow-next-thing meow-word-thing 'word (- n)))

(defun meow-back-symbol (n)
"Select to the beginning the previous Nth symbol.
A non-expandable word selection will be created.
This command works similar to `meow-next-symbol'."
(interactive "p")
(meow-next-thing meow-symbol-thing 'symbol (- n) "_w "))
(meow-next-thing meow-symbol-thing 'symbol (- n)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; LINE SELECTION
Expand Down
10 changes: 10 additions & 0 deletions meow-var.el
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ This will affect how selection is displayed."
:group 'meow
:type 'number)

(defcustom meow-next-thing-include-syntax
'((word " _w" " _w")
(symbol " _w" " _w"))
"The syntax to include selecting with meow-next-THING.
Each item is a (THING FORWARD_SYNTAX_TO_INCLUDE BACKWARD-SYNTAX_TO_INCLUDE)."
:group 'meow
:type '(list :key-type (symbol :tag "Thing")
:value-type (list string)))

(defcustom meow-expand-hint-counts
'((word . 30)
(line . 30)
Expand Down

0 comments on commit 13733e1

Please sign in to comment.