This PR targets 2 pain points.
1. The `Explore` message was async, which caused some unexpected
behavior. This was fixed by splitting `Explore` into `ExplorePwd`,
`ExplorePwdAsync` and `ExploreParentsAsync`. `ExploreParentsAsync`
is similar to the former `Explore`, which is mainly used when loading
`xplr` for the first time. However, what we'll be using frequently
are `ExplorePwd` and `ExplorePwdAsync` messages.
2. Files with spaces caused some unexpected behavior. This was fixed by
escaping the paths properly. This also fixed focusing of a file after
creating or renaming it.
Anothor breaking change is that `XPLR_PIPE_FOCUS_OUT` has been removed.
`XPLR_FOCUS_PATH` is all we need. So, the rule of thumb is if a variable
contains one liner value, it can be used directly from the env vars.
Variables that can contain multi-line values, will be exposed via the
pipes.
Minor changes are
- Add `switch_mode` mode to the global key binding help menu
- Moved some UI related code from config.rs to ui.rs.
- Fixed compilation issue on `rustc 1.50.0`.
From this commit, the app state will be written to the output pipes only
when invoking a command.
For auto refreshing pipes, we can brainstorm on `service`s concept.
With this commit, the following can be done:
- Define layout constraints based on screen size and relative panel
size.
- Define borders.
- Define panel style.
- Define panel title and title style.
Any layouts will default to `Nothing` which resembles blank screen.
However, they will be overwritten when there is a more specific layout
available either in the super config or in the sub config.
Now, users can change the UI layout via the `SwitchLayout{Builtin|Custom}`
message, or by using key `ctrl-w`.
There are 3 default layout options -
- default
- no_help
- no_selection
- no_help_no_selection
Also, the initial mode and the initial layout can be specified in the
config.
Closes: https://github.com/sayanarijit/xplr/issues/107