File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,12 @@ Include path to the executable if it is not in your $PATH."
170170 :type '(repeat symbol)
171171 :group 'drupal )
172172
173+ ;;;### autoload
174+ (defcustom drupal-ignore-paths-regexp " \\ (vendor\\ |node_modules\\ )"
175+ " Don't enable Drupal mode per default in files whose path match this regexp."
176+ :type 'regexp
177+ :group 'drupal )
178+
173179(defcustom drupal-enable-auto-fill-mode t
174180 " Whether to use `auto-fill-mode' in Drupal PHP buffers.
175181Drupal mode will only do auto fill in comments (auto filling code
@@ -845,8 +851,10 @@ The function is suitable for adding to the supported major modes
845851mode-hook."
846852 (when (apply 'derived-mode-p (append drupal-php-modes drupal-css-modes drupal-js-modes drupal-info-modes drupal-other-modes))
847853 (drupal-detect-drupal-version)
848- (when (or drupal-version
849- (string-match " drush" (or buffer-file-name default-directory)))
854+ (when (and
855+ (or drupal-version
856+ (string-match " drush" (or buffer-file-name default-directory)))
857+ (not (string-match drupal-ignore-paths-regexp (or buffer-file-name default-directory))))
850858 (drupal-mode 1 ))))
851859
852860;;;### autoload
You can’t perform that action at this time.
0 commit comments