Commit Graph

190 Commits (main)

Author SHA1 Message Date
Arijit Basu 25a9d03237 Finish porting config.yml to init.lua 3 years ago
Arijit Basu 0a2f2aeda8 Fix version 3 years ago
Arijit Basu 074e0d1250 Replace handlebars with Lua
Replace handlebars with Lua functions by introduction Lua function API.
3 years ago
Arijit Basu f744553a0a Add support for native lua bindings
Ref: https://github.com/sayanarijit/xplr/discussions/146#discussioncomment-741580
3 years ago
Arijit Basu 8e98da5004 Add support for un-mapping keys.
Use `remaps: {key: null}` to un-map a key.

Also,
- `gx` will now open only the file under focus.
- `:sx` will open the selected files.

And other minor improvements.

Discussion: https://github.com/sayanarijit/xplr/discussions/146
3 years ago
Arijit Basu ae8a391064 Introduce `PopMode`
This change requires manual `Refresh` after mode switches.
Also, fix the rename operation.
3 years ago
Arijit Basu e0f8207900 Improve key bindings
Stay in the current mode when key input is not recognised. It's better
to do nothing than doing something wrong, at least when dealing with
important files and folders.
3 years ago
Arijit Basu 9597e78387 Remove unused dev dependencies
For now, we're only using criterion. I hope we bring them back soon with
real purpose.
3 years ago
Arijit Basu b64d6b59a5 Remove dependency notify
Using a whole crate just to watch `$PWD` for the last modification time
was a overkill.
3 years ago
Arijit Basu 50d6edb168 Fix search 3 years ago
Arijit Basu 3e812045e6
Fix release 3 years ago
Arijit Basu 92545f6387 Fix rename breaking UI 3 years ago
Arijit Basu 7c5468cabe Fix exploring and escaping paths
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`.
3 years ago
Arijit Basu 52fbaef189 Fix displaying global help menu
Also support toggle selection in search mode.
And use a pager to display logs.
3 years ago
Arijit Basu 9e89c6503d Use key `tab` to select files in search mode
Select files fzf style in search mode, without losing the search input.

Also, make background tasks failsafe and measure ui rendering.
3 years ago
Arijit Basu 38812e733b Improve config inheritance for layout UI
With this commit, users will be able to define the common configuration
as super config and inherit from them in each layout.
3 years ago
Arijit Basu b3e6679b50 Add feature dynamic UI
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
3 years ago
Arijit Basu 0584a43c7c Add SwitchModeBuiltin and SwitchModeCustom
Also, use a better prompt symbol.

Ref: https://github.com/sayanarijit/xplr/issues/107
3 years ago
Arijit Basu 2c7ec47253 Fix `cd` on first focus
Fix issue where running `xplr /path/to/file` doesn't `cd` into the
parent directory.
3 years ago
Arijit Basu 1c967cfef6 Update version 3 years ago
Arijit Basu 36af3e8ced Fix pipes not updating properly
Let's not optimize things until we have tests.
3 years ago
Arijit Basu 4dad10815a Fix support for filenames starting with - (hiphen)
Make it possible to create, delete, copy, move, rename filenames starting
with a - (hiphen).
3 years ago
Arijit Basu 2437fd67cf Fix distorted screen when opening files in GUI
Fixes: https://github.com/sayanarijit/xplr/issues/111
3 years ago
Arijit Basu eca35c73a2 Update version 3 years ago
Arijit Basu e9b5dfe478 Fix incompatible config version
Fixes: https://github.com/sayanarijit/xplr/issues/97
3 years ago
Arijit Basu 36c2c9cc2b
Update version 3 years ago
Arijit Basu 1ffa85f30f Do not exit on permission denial
While trying to enter restricted directories, log error instead or
exiting.
3 years ago
Arijit Basu ad3dd8eec2
Update version 3 years ago
Arijit Basu c11099f651 Fix follow symlink behavior.
Use `gf` to follow symlinks instead of `enter`/`l`.

Or use the message `FollowSymlink`.
3 years ago
Arijit Basu 87cd6ff015 Fix global help menu not displaying sort & filter 3 years ago
Arijit Basu ca13ebb193 Added inode size
Also supports sorting by inode size.

Closes: https://github.com/sayanarijit/xplr/issues/84
3 years ago
Arijit Basu a8896740c8 Add sorting support
Also improve filtering.

Closes: https://github.com/sayanarijit/xplr/issues/58
3 years ago
Arijit Basu d0342260fe Add support for NO_COLOR
Also, add `general.logs` to the config.

Ref: https://no-color.org/
3 years ago
Arijit Basu ea42b1969a Improve scrolling behaviour
Closes: https://github.com/sayanarijit/xplr/issues/54
3 years ago
Arijit Basu 49ffd8e1f1 Fix exit error codes
Also remove cucumber-rust (will try https://github.com/rust-rspec/rspec)

Fixes: https://github.com/sayanarijit/xplr/issues/33
3 years ago
Arijit Basu f247acf626 Fix remap behaviour and help menu
Remapping a key should overwrite default. Also, remapped keys shouldn't
be redundantly visible in help menu.

Also, display log time.
3 years ago
Arijit Basu d34dc77ea5 Initial BDD testing setup 3 years ago
Arijit Basu 080e1686f3 Improve version compatibility
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.
3 years ago
Arijit Basu 6aa3df301e Separate config.yml file from rust files
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
3 years ago
Arijit Basu 233f6d44a5
Update version 3 years ago
Arijit Basu b9e9601a71
Fix failed build and update version 3 years ago
Arijit Basu c06a3cb51e
Update version 3 years ago
Arijit Basu 6d0ea06d7b Add pwd watcher
Also optimize the main thread.
3 years ago
Arijit Basu 0a3cf7b5c1
Update version 3 years ago
Arijit Basu fa37cd1c10 Improve search and filter
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.
3 years ago
Arijit Basu 91a319fc80
Update version 3 years ago
Arijit Basu 23b51cf8fe
Fix failed build and re-publish 3 years ago
Arijit Basu 2bd2b743fb
Fix renaming 3 years ago
Arijit Basu a484c2fd39
Update default.nix 3 years ago
Arijit Basu 65ddb0ee4b
Release 0.3.2 3 years ago
Arijit Basu eeee3394bc Improve version incompatibility error
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.
3 years ago
Arijit Basu 981ead8c36 Fix large env vars breaking the subprocess
Bug:
When you call some command in a directory with a large number of hosts,
xplr will fail setting the environment vars as the command will become
too large to handle.

Fix:
Port the value of multi-line variables from env vars to pipes and set
the name of the pipe as env var instead. And deprecate the variables
that doesn't make much sense.

In other words,

- `$XPLR_APP_YAML` has been removed.
- `$XPLR_RESULT` has been ported to `$XPLR_PIPE_RESULT_OUT`.
- `$XPLR_GLOBAL_HELP_MENU` has been ported to
  `$XPLR_PIPE_GLOBAL_HELP_MENU_OUT`.
- `$XPLR_DIRECTORY_NODES` has been ported to
  `$XPLR_PIPE_DIRECTORY_NODES_OUT`.
- `$XPLR_LOGS` has been ported to `$XPLR_PIPE_LOGS_OUT`.
- `$XPLR_PIPE_RESULT` has been ported to `$XPLR_PIPE_RESULT_OUT`.

Hence, instead of `<<< $VAR`, `< $VAR_PIPE_OUT` should be used.
3 years ago
Arijit Basu 9747c8667b Autocomplete the relative path while renaming
By default, while renaming a file, autocomplete the relative path i.e.
the filename instead of the absolute path in the input buffer.
3 years ago
Arijit Basu 67f2094a4c Autorefresh, BashExec and basename
- Auto `Refresh` every second.
- Add alias `BashExec` to message `Call` with args [`-c`, `bash` ...].

Also, Create alias `BashExec` to message `Call` with arguments [`bash`, `-c`]
3 years ago
Arijit Basu 8dae2fef4d
Add native support for renaming 3 years ago
Arijit Basu 2432673483
Log error if command fails 3 years ago
Arijit Basu b03618737c
Remove skim from dependency 3 years ago
Arijit Basu 4d2caf512e
Log explorer errors 3 years ago
Arijit Basu e93e815bc4
Add upgrade instructions for incompatibility error 3 years ago
Arijit Basu a11dca5a1c
Finish documenting the messages 3 years ago
Arijit Basu af8a637030
Logging, testing and other improvements 3 years ago
Arijit Basu 71a23e1f64
Implement native search and filter 3 years ago
Arijit Basu 7cbb9d2baf
Saner key bindings 3 years ago
Arijit Basu c0ca596539
Fix create mode, refactor readers, fix init focus 3 years ago
Arijit Basu 3990200232
Anyhow handle errors 3 years ago
Arijit Basu 56d63a2316
Move, Copy, Create, Delete 3 years ago
Arijit Basu eb6bc6b6be
Minor buggy improvements 3 years ago
Arijit Basu 107211a69c
Add ctrl-c handler 3 years ago
Arijit Basu f43ba87a2b
Finish Selected -> Selection renaming 3 years ago
Arijit Basu 8a6da63936
Rename selected -> selection 3 years ago
Arijit Basu b70682ecb5
Fix term resize handler 3 years ago
Arijit Basu 2c56b80fde
Minor fixes 3 years ago
Arijit Basu f176655325
Some improvements and cleanup 3 years ago
Arijit Basu 341d11a0f3
Fix pipes config 3 years ago
Arijit Basu c066201777
Read config from file 3 years ago
Arijit Basu 3572d26b95
Too big of a rewrite 3 years ago
Arijit Basu 98920637f9
Number input 3 years ago
Arijit Basu d5bfe6630f
Use app.task instead of separate variables 3 years ago
Arijit Basu 21e4a178c7
Fix escaping relative path
Either escape or quote. Don't do both at once.
3 years ago
Arijit Basu 096489dee4
Use "esc" instead of "escape" 3 years ago
Arijit Basu 7beaec1763
Easier key handling 3 years ago
Arijit Basu 8221140756
Refresh after running command 3 years ago
Arijit Basu 044b7860a1
Fixed fzf search added pwd shell option
Now I can finally use it to replace nnn
3 years ago
Arijit Basu 980fb8728a
Editor fix 3 years ago
Arijit Basu 03fffd19e2
Minor fixes 3 years ago
Arijit Basu df8c03ce2d
Add shell words escaper 3 years ago
Arijit Basu 2e551ce38d
Support for command action 3 years ago
Arijit Basu 758f362fee
Lazy programmer hack for key bindings 3 years ago
Arijit Basu 720ba38b4d
Some important fix (don't look) 3 years ago
Arijit Basu f9c3edee06
Not yet doing what it's supposed to 3 years ago