diff options
| author | 2026-04-13 14:48:21 -0700 | |
|---|---|---|
| committer | 2026-04-13 14:48:21 -0700 | |
| commit | d01b3db1383d6b967455782b8668ed3a3f9c22b1 (patch) | |
| tree | cffb032b96afa1c72020a6fc28ab2b5c5752bacd | |
| parent | 5a0a24b8c84cd768b27aed7cd03831522ae34cad (diff) | |
| download | emacs-config-d01b3db1383d6b967455782b8668ed3a3f9c22b1.tar.gz emacs-config-d01b3db1383d6b967455782b8668ed3a3f9c22b1.zip | |
oni-php: Fix up inserting ‘->’ vs ‘::’
When we're looking at a ‘)’ it should be ‘->’ since we can't return a static
class in that case.
| -rw-r--r-- | oni-php/oni-php.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 612d645..1415d2b 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2026.0406.154601 +;; Version: 2026.0407.170526 ;; Package-Requires: (oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters rainbow-identifiers) ;; This program is free software; you can redistribute it and/or modify @@ -122,8 +122,7 @@ nil for some reason." Do the insert N times." (interactive "p") - (if (or (char-equal ?\ (char-before (point))) - (oni-php--in-string-or-comment-p) + (if (or (oni-php--in-string-or-comment-p) (save-excursion (skip-syntax-backward " ") (nth 3 (syntax-ppss (1- (point))))) @@ -131,8 +130,8 @@ Do the insert N times." (skip-syntax-forward " ") (nth 3 (syntax-ppss (1+ (point)))))) (self-insert-command N) - (let ((op (if (looking-back (rx "$" (minimal-match (one-or-more (any alnum "->")))) - (line-beginning-position)) + (let ((op (if (looking-back (rx (or "$" ")") (zero-or-more (any whitespace "\n" alnum "(" ")" "->"))) + (save-excursion (backward-paragraph) (point))) "->" "::"))) (dotimes (_ N) (insert op))))) |
