diff --git a/core/core-editor.el b/core/core-editor.el index 97976592f..f27e1ee70 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -39,13 +39,13 @@ possible." (if (setq doom-large-file-p (and buffer-file-name (not doom-large-file-p) - (not (memq major-mode doom-large-file-excluded-modes)) (file-readable-p buffer-file-name) (> (nth 7 (file-attributes buffer-file-name)) (* 1024 1024 doom-large-file-size)))) - (delay-mode-hooks - (prog1 (apply orig-fn args) - (buffer-disable-undo) + (prog1 (apply orig-fn args) + (if (memq major-mode doom-large-file-excluded-modes) + (setq doom-large-file-p nil) + (so-long-minor-mode +1) (message "Large file detected! Cutting a few corners to improve performance..."))) (apply orig-fn args)))