From dac2186768046d1861d82b6f31085842b28b7477 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 7 Mar 2025 10:42:34 -0800 Subject: oni-php: Make ‘oni-php-comment-dwim’ work with classes --- oni-php/oni-php.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'oni-php') 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))) -- cgit v1.3-2-g0d8e