From this version, xplr won't annoy the users to visit the upgrade guide
when there is no need.
Also, users will only get upgrade related notification when it is
there is one.
- Rename `custom` field for node metadata to `meta`.
- Move `icon` to `meta.icon`.
- Rename `normal_ui` to `default_ui`.
- Rename `filetypes` to `node_types`.
- Split `modes` into `modes.builtin` and `modes.custom`.
- Add the missing `create file` mode.
- Rename `focused_ui` to `focus_ui`.
- Make `general.table.header` non-nullable.
- Add support for incremental configuration updates.
Ref: https://github.com/sayanarijit/xplr/issues/45
Also be less aggressive for version compatibility.
Use the following logic:
Knowing that we use `{major}.{minor}.{patch}` versioning,
- Major version mismatch are incompatible. Fail with error, suggesting to
visit the Upgrade Guide.
- Minor version updates and patch fixes are compatible. Suggest user to
update the config file version manually. Or visit the Upgrade Guide.
- However, if the config file has greater value for minor version
than the app, also fail with error. Suggesting the user to visit Upgrade
Guide. Though in this case, the user will be downgrading.
Ref: https://github.com/sayanarijit/xplr/issues/45
Some commands doesn't require to capture stdout and stderr.
They can be called without needing to reset the screen.
Add `CallSilently` and `BashExecSilently` to execute those commands
faster.
Also, some optimization.
Removed comma.
Error was as follows:
error: no rules expected the token `,`
--> src/input.rs:373:29
|
373 | | Self::Num9,
| ^ no rules expected this token in macro call
error: aborting due to previous error
Example:
```yaml
filetypes:
directory:
custom:
foo: bar
...
```
Where `foo` and `bar` can be anything string.
It can be accessed with the `{{{custom.foo}}}` variable.
This might be a little counter intuitive to the `nnn` users, but I think
this will add to the productivity and should be the default.
Since we have a real-time mode indicator, users shouldn't face much of
an issue switching to the alternate default.
Issue:
`esc` is generally used to get back to the `default` mode and mistakenly
pressing `esc` while in `default` mode will annoyingly terminate the
session.
Fix:
Remove `esc` from the `default` mode's key bindings. Use `q` or `crtl-c`
instead.
Concern:
Using `ResetNodeFilters` to clear the filters while searching or exiting
from search unexpectedly resets the `show hidden` mode because the
action not only removes the target filter, it resets all the other
filters as well.
Solution:
Implement `RemoveNodeFilterFromInput` to be able to clear or remove
target filters without having to reset it.
Since users don't need to update config file version for minor app
releases, we have to differentiate between app and config version.
Also, expose them via `$XPLR_CONFIG_VERSION` and `$XPLR_APP_VERSION`.
With this change, `xplr` will only raise version incompatibility error
if the major version changes. Minor version updates are assumed to be
backwards compatible.
If the major version is `v0`, the minor version will be considered as
the major version and the security/patch version will be considered as
minor version and the same logic will apply.