]> git.lizzy.rs Git - micro.git/commit
More efficient loading for default syntax files
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 29 Dec 2019 02:26:22 +0000 (21:26 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 29 Dec 2019 02:26:22 +0000 (21:26 -0500)
commita61616d79e67a4c9bf267fa10fcd2689d5edd742
tree41f72a589a9c05a12e6fc3ddcb1cfcb53121be66
parent8663014bbe9d7d5fdead5167bbcdf79c2545f880
More efficient loading for default syntax files

This change introduces header files for syntax files. The header
files only contain the filetype and detection info and can be
parsed much faster than parsing a full yaml file. To determine
which filetype a file is, only scanning the headers is necessary
and afterwards only one yaml file needs to be parsed. Use the
make_headers.go file to generate the header files. Micro expects
that all default syntax files will have header files and that
custom user syntax files may or may not have them. Resolving
includes within syntax has not yet been implemented. This
optimization improves startup time.

Ref #1427
Makefile
internal/buffer/backup.go
internal/buffer/buffer.go
internal/config/rtfiles.go
internal/config/runtime.go
pkg/highlight/parser.go