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 128128 :type '(alist :key-type function
129129 :value-type symbol)
130130 :group 'php-format )
131+
132+ (defcustom php-format-disable-async-format-buffer-has-modified t
133+ " When non-NIL, disable asynchronous formatting if the buffer has modified (not saved)."
134+ :tag " PHP Format Disable Async Format Buffer Has Modified"
135+ :type 'boolean
136+ :group 'php-format )
131137
132138; ; Internal functions
133139(defsubst php-format--register-timer (sec command-args )
182188 " Asynchronously execute PHP format with COMMAND-ARGS in DIR."
183189 (setq php-format--idle-timer nil )
184190 (let ((default-directory dir))
185- (apply #'call-process-shell-command (car command-args) nil nil nil
186- (append (cdr command-args) (list " &" )))))
191+ (when (not (and php-format-disable-async-format-buffer-has-modified
192+ (buffer-modified-p )))
193+ (apply #'call-process-shell-command (car command-args) nil nil nil
194+ (append (cdr command-args) (list " &" ))))))
187195
188196; ; Public functions and minor mode
189197
You can’t perform that action at this time.
0 commit comments