diff options
| author | 2025-03-07 10:42:34 -0800 | |
|---|---|---|
| committer | 2025-04-07 14:20:55 -0700 | |
| commit | dac2186768046d1861d82b6f31085842b28b7477 (patch) | |
| tree | 6a21de703ae549cb61571260be1c0a2fdac9ffe8 | |
| parent | 1fa91ab306c7a7e917fecf1f653f11a640620941 (diff) | |
| download | emacs-config-dac2186768046d1861d82b6f31085842b28b7477.tar.gz emacs-config-dac2186768046d1861d82b6f31085842b28b7477.zip | |
oni-php: Make ‘oni-php-comment-dwim’ work with classes
| -rw-r--r-- | oni-php/oni-php.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 1eebc29..630e4bc 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -126,9 +126,10 @@ Do the insert N times." Otherwise call FUNC with ARGS. This is meant as advice around ‘comment-dwim’ to make it smarter for PHP code." (if (and (derived-mode-p 'php-mode) - (looking-back (rx blank) (line-beginning-position)) + (looking-back (rx (minimal-match (zero-or-more blank))) (line-beginning-position)) (looking-at (rx (minimal-match (zero-or-more (any whitespace "\n"))) - (regexp php-beginning-of-defun-regexp)))) + (or (regexp php-beginning-of-defun-regexp) + (regexp php--re-classlike-pattern))))) (oni-php-doc-comment) (apply func args))) |
