helix-mirror/book/src
paul-scott ce1fb9e64c
Generalised to multiple runtime directories with priorities (#5411)
* Generalised to multiple runtime directories with priorities

This is an implementation for #3346.

Previously, one of the following runtime directories were used:

1. `$HELIX_RUNTIME`
2. sibling directory to `$CARGO_MANIFEST_DIR`
3. subdirectory of user config directory
4. subdirectory of path to helix executable

The first directory provided / found to exist in this order was used as a
root for all runtime file searches (grammars, themes, queries).

This change lowers the priority of `$HELIX_RUNTIME` so that the user
config runtime has higher priority. More significantly, all of these
directories are now searched for runtime files, enabling a user to override
default or system-level runtime files. If the same file name appears
in multiple runtime directories, the following priority is now used:

1. sibling directory to `$CARGO_MANIFEST_DIR`
2. subdirectory of user config directory
3. `$HELIX_RUNTIME`
4. subdirectory of path to helix executable

One exception to this rule is that a user can have a `themes`
directory directly in the user config directory that has higher piority
to `themes` directories in runtime directories. That behaviour has been
preserved.

As part of implementing this feature `theme::Loader` was simplified
and the cycle detection logic of the theme inheritance was improved to
cover more cases and to be more explicit.

* Removed AsRef usage to avoid binary growth

* Health displaying ;-separated runtime dirs

* Changed HELIX_RUNTIME build from src instructions

* Updated doc for more detail on runtime directories

* Improved health symlink printing and theme cycle errors

The health display of runtime symlinks now prints both ends of the
link.

Separate errors are given when theme file is not found and when the
only theme file found would form an inheritence cycle.

* Satisfied clippy on passing Path

* Clarified highest priority runtime directory purpose

* Further clarified multiple runtime details in book

Also gave markdown headings to subsections.

Fixed a error with table indentation not building
table that also appears present on master.

---------

Co-authored-by: Paul Scott <paul.scott@anu.edu.au>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2023-03-09 23:50:43 +09:00
..
generated Add command for resetting diff hunks (#5736) 2023-03-08 10:49:14 +09:00
guides Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
commands.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
configuration.md Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
from-vim.md Fix typos (#3858) 2022-09-17 06:34:48 -05:00
install.md Generalised to multiple runtime directories with priorities (#5411) 2023-03-09 23:50:43 +09:00
keymap.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
lang-support.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
languages.md Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
remapping.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
SUMMARY.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
themes.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00
title-page.md book: add wiki links to the title page and install page (#3017) 2022-07-09 11:08:47 -05:00
usage.md Rewrite and refactor all documentation (#5534) 2023-03-06 18:27:17 +09:00