From 7e7c283528f28c24bdf1c9449e787072f8bf8d8b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 9 Feb 2026 12:12:37 -0800 Subject: oni-php: ‘oni-php-add-use’: Search for existing use more strictly Before searching for ‘App\Models\Promotion’ would also match ‘App\Models\PromotionBulkImport’ and not add the use, but by searching for ‘use App\Models\Promotion;’ we ensure that we don't accidentally match a substring. --- oni-php/oni-php.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 88af7af..fd12545 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2026.0107.143829 +;; Version: 2026.0209.115456 ;; Package-Requires: (php-mode 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 @@ -97,7 +97,7 @@ nil for some reason." (forward-line) (insert "\n")) - (unless (search-backward class nil t) + (unless (re-search-backward (rx "use " (literal class) ";") nil t) (let ((start (point))) (insert "use " class ";\n") (pulse-momentary-highlight-region start (point))))))) -- cgit v1.3-2-g0d8e