From ba9102ed1b484bb9e30ff48008da5cbb14b2de8d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 9 Mar 2026 16:45:50 -0700 Subject: oni-php: oni-php-comment-dwim: Require inactive region If the region is active, don't try to be smart about what to insert, just do the normal ‘comment-dwim’. --- oni-php/oni-php.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'oni-php') diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index fd12545..f910d23 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2026.0209.115456 +;; Version: 2026.0306.123604 ;; 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 @@ -134,6 +134,7 @@ 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) + (not (region-active-p)) (looking-back (rx (minimal-match (zero-or-more blank))) (line-beginning-position)) (looking-at (rx (minimal-match (zero-or-more (any whitespace "\n"))) (or (regexp php-beginning-of-defun-regexp) -- cgit v1.3-2-g0d8e