core-editor: refactor large-file detection
This commit is contained in:
parent
404428d860
commit
09218f5bb3
2 changed files with 21 additions and 21 deletions
|
@ -207,16 +207,3 @@ for function signatures or notes. Run again to clear the header line."
|
|||
(setq content (replace-regexp-in-string "\\s-+" " " content))
|
||||
content)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/check-large-file ()
|
||||
(let* ((filename (buffer-file-name))
|
||||
(size (nth 7 (file-attributes filename))))
|
||||
(when (and
|
||||
(not (memq major-mode doom-large-file-modes-list))
|
||||
size (> size (* 1024 1024 doom-large-file-size))
|
||||
(y-or-n-p (format (concat "%s is a large file, open literally to "
|
||||
"avoid performance issues?")
|
||||
filename)))
|
||||
(setq buffer-read-only t)
|
||||
(buffer-disable-undo)
|
||||
(fundamental-mode))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue