Skip to content

Commit 8837e4b

Browse files
committed
Add a predicate function
1 parent a9ff37f commit 8837e4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rime-predicates.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ Can be used in `rime-disable-predicates' and `rime-inline-predicates'."
189189
(or (string-match-p "[\x5c][\x21-\x24\x26-\x7e]*$" string)
190190
(string-match-p "[\x5c][a-zA-Z\x23\x40]+[\x7b][^\x7d\x25]*$" string)))))))
191191

192+
(defun rime-predicate-punctuation-after-space-en-p ()
193+
"If input a punctuation after an English character with whitespace."
194+
(and (> (point) (save-excursion (back-to-indentation) (point)))
195+
(rime-predicate-current-input-punctuation-p)
196+
(let ((string (buffer-substring (point) (max (line-beginning-position) (- (point) 80)))))
197+
(string-match-p "[a-zA-Z] +$" string))))
198+
192199
;; Obsoleted functions:
193200
(define-obsolete-function-alias 'rime--after-alphabet-char-p 'rime-predicate-after-alphabet-char-p "2020-03-26")
194201
(define-obsolete-function-alias 'rime--prog-in-code-p 'rime-predicate-prog-in-code-p "2020-03-26")

0 commit comments

Comments
 (0)