fix(editor): do not highlight indentation levels on large files

This prevents larger files from causing latency and lag, especially
large YAML files, like generate Kubernetes menifests.

This fix here simply does not enable highlighting indentation levels if
the file is above 100KB in size. In my experience it's rare a file meant
to be manually edited by a human is above 100KB in size.
This commit is contained in:
2021-08-03 01:18:31 +01:00
parent 6bfa362ee2
commit 0435cb28d6

View File

@@ -21,7 +21,11 @@
"Default coding hook, useful with any programming language."
(setq-local fill-column 80)
(siren-display-indentation 1)
;; Only show indentation if file size is below 100KB. It tends to cause a lot
;; of lag and slowdowns on larger files, especially YAML files.
(if (< (buffer-size) (* 100 1024))
(siren-display-indentation 1))
(hl-line-mode t)
(visual-line-mode t)
(whitespace-mode t)))