aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-04-07 14:19:14 -0700
committerGravatar Tom Willemse2025-04-07 14:20:55 -0700
commit31b1d69b0eab126fa1a721158bf4906d28016bab (patch)
tree0beb498f49dd3ce9108221451dfa90879bee4157
parentceba96db234c773e05e18b6010e54fa7d830dc56 (diff)
downloademacs-config-31b1d69b0eab126fa1a721158bf4906d28016bab.tar.gz
emacs-config-31b1d69b0eab126fa1a721158bf4906d28016bab.zip
oni-php: Make sure imports aren't duplicated
-rw-r--r--oni-php/oni-php.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el
index ce75ac3..dc4e324 100644
--- a/oni-php/oni-php.el
+++ b/oni-php/oni-php.el
@@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2025.0307.104352
-;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra ggtags fic-mode company-php rainbow-delimiters)
+;; Version: 2025.0310.102726
+;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra oni-smartparens ggtags fic-mode company-php rainbow-delimiters)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -90,9 +90,10 @@ nil for some reason."
(forward-line)
(insert "\n"))
- (let ((start (point)))
- (insert "use " class ";\n")
- (pulse-momentary-highlight-region start (point))))))
+ (unless (search-backward class nil t)
+ (let ((start (point)))
+ (insert "use " class ";\n")
+ (pulse-momentary-highlight-region start (point)))))))
(defun oni-php-insert-dot-dwim (N)
"Insert either a concatenation or access operator depending on context.