Commit Graph

199 Commits

Author SHA1 Message Date
Arijit Basu
57483bef41 Use fuzzy search instead of regex search
Ref: https://github.com/sayanarijit/xplr/issues/496
2022-10-06 20:48:29 +05:30
Arijit Basu
93bd53bbcb Add quick scrolling
Not ideal, but better than nothing.

Closes: https://github.com/sayanarijit/xplr/issues/509
2022-10-06 20:42:23 +05:30
Arijit Basu
58c572d77a Fix directory explore scheduling
Fixes https://github.com/sayanarijit/xplr/issues/503
2022-09-11 08:16:38 +05:30
Arijit Basu
4e9c056a10 Custom input prompts for different modes without SetInputPrompt
Closes: https://github.com/sayanarijit/xplr/issues/502
2022-09-11 01:16:11 +05:30
Arijit Basu
096e520a2b Fix clippy err 2022-09-10 23:19:47 +05:30
Arijit Basu
bea0f277bc Add global key bindings that can be overwritten.
- Use `xplr.config.general.global_key_bindings` to define a set of
  key bindings that are available by default in every mode. e.g `esc`
  and `ctrl-c`.
- Remove boilerplate config from `init.lua`.
- Update docs.
2022-06-06 19:43:58 +05:30
Arijit Basu
5370cc2e8c Go to path and native auto completion on tab
- BREAKING: Rename mode `create directory` and `create file` to
  `create_directory` and `create_file`.
- Add key binding `gp` to go to a given path from input.
- Add function `fn.builtin.try_complete_path` to auto complete the path
  in input buffer.
- Use `tab` to auto complete path in `rename`, `create_file`,
  `create_directory` and `go_to_path` modes.
- Show different prompts in different modes.

And some cleanup.
2022-06-03 22:09:14 +05:30
Arijit Basu
e04b0964ae Use 89 chars line length 2022-06-02 22:45:19 +05:30
Arijit Basu
d35a4c58cb Write OSC 7 escaped codes on a the tui backend 2022-06-02 18:13:33 +05:30
Arijit Basu
47f7d51e46 Cleanups 2022-06-02 18:13:33 +05:30
Arijit Basu
de856b7870 Implement Write 2022-06-02 18:13:33 +05:30
Arijit Basu
2f9992bf8b OSC 7 fixes
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2022-06-02 18:13:33 +05:30
Arijit Basu
3c8f6e1b08 Experiment with OSC 7
Ref: https://github.com/wez/wezterm/issues/2054
2022-06-02 18:13:33 +05:30
Arijit Basu
2179be473f Fix docs 2022-05-21 02:46:55 +05:30
Arijit Basu
8e1d16b751 Remove merge conflicts 2022-05-21 02:46:55 +05:30
Arijit Basu
37e660e0a6 Improve timestamp support 2022-05-21 02:46:55 +05:30
Shunsuke Mie
57c29d47c5 Support a column shows time of modification 2022-05-21 02:46:55 +05:30
Arijit Basu
5f598648a8 Make the prompt not null 2022-05-21 00:12:58 +05:30
Arijit Basu
1de737cefa Add regex support and dynamic input prompt
- Add new regex filters
  - `RelativePathDoesMatchRegex`
  - `RelativePathDoesNotMatchRegex`
  - `IRelativePathDoesMatchRegex`
  - `IRelativePathDoesNotMatchRegex`
  - `AbsolutePathDoesMatchRegex`
  - `AbsolutePathDoesNotMatchRegex`
  - `IAbsolutePathDoesMatchRegex`
  - `IAbsolutePathDoesNotMatchRegex`
- Search mode now defaults to regex
- Added new message `SetInputPrompt` to set the input prompt
  dynamically.
2022-05-21 00:12:58 +05:30
Arijit Basu
0d12762c1d
Upgrade tui-input to 0.4.0 2022-05-16 12:15:50 +05:30
Arijit Basu
a66d5e05d5
Upgrade to tui-input 0.3 2022-05-15 21:21:38 +05:30
Arijit Basu
171c93dbb1 Fix ansi colors
Also upgrade deps and do some cleanup.
2022-05-04 09:43:14 +05:30
Arijit Basu
3d81a49cec Auto generate messages docs
- Huge refactor.
- Run `python docs/script/generate.py` to generate `docs/en/src/messages.md`.
2022-02-27 23:21:51 +05:30
Arijit Basu
ecc59b1d9d Option to configure wrapping on move
Closes: https://github.com/sayanarijit/xplr/issues/441
2022-02-26 23:07:47 +05:30
Arijit Basu
bb65870ee0 CLI for a better "cd on quit"
Use `--print-pwd-as-result` to print the last working directory instead
of the focused or selected nodes, when you quit using the `PrintResultAndQuit`
message (i.e. by pressing `enter`).

This helps with implementing the "cd on quit" functionality using a plain shell
alias.

Example:

```
alias xcd='cd "$(xplr --print-pwd-as-result)"'
```

With this alias set, you can navigate directories using xplr by entering
`xcd` command, and when you quit by pressing enter, you will enter the
directory.

You can of course, quit with plain `Quit` (i.e. by pressing `esc`) to
gracefully cancel "cd on quit".
2022-02-03 09:31:28 +05:30
Arijit Basu
e6ea983a8a Add "duplicate as"
Closes https://github.com/sayanarijit/xplr/issues/434
2022-01-21 15:27:21 +05:30
Arijit Basu
24bd6d9f00 Merge the pending changes from #429 2022-01-11 12:27:07 +05:30
Tom van Dijk
17f3893198
Debug mode
Features:
- Display debug menu on configuration error
- Configure wether xplr should show the debug menu
    (through `debug_on_error`)
- Open logs in editor
- Redirect people to the issues page on Github.
2021-12-30 13:21:34 +01:00
Arijit Basu
8f5e5491f2 Optimize change directory performance
This PR breaks the custom layout renderer API by deprecating the
following heavyweight fields in the Lua Context passed to the renderer
functions.

The following fields are being deprecated:

- app.directory_buffer
- app.history
- app.last_modes

However, there's no change in the Lua Context passed to the functions
called via `CallLua*` messages.

Closes: https://github.com/sayanarijit/xplr/issues/418
2021-12-11 19:37:40 +05:30
Arijit Basu
41c387542f Fix auto jumping on cursor when visiting large dir 2021-11-15 18:08:03 +05:30
Arijit Basu
7c7351c2e8 Optimize optimization hack 2021-11-15 18:08:03 +05:30
Arijit Basu
5211e4fa40 Fix Lua API performance by caching
Fixes: https://github.com/sayanarijit/xplr/issues/412
2021-11-15 18:08:03 +05:30
Arijit Basu
f78d9e99fd
Remove debug statement and add tests 2021-11-07 09:14:33 +05:30
Arijit Basu
b0c91a954e
Improve update_input_buffer 2021-11-05 18:05:04 +05:30
Arijit Basu
074217f21e Fix issue with input buffer 2021-11-05 18:07:20 +05:30
Arijit Basu
48ab6eac21 Add on_function key handler
This adds `on_function` handler to handle F1-F12 keys.

This also fixes issues with previously added handlers and adds a
checklist for future additions.
2021-11-05 17:54:17 +05:30
Arijit Basu
6a3b26cc18 Add support for LuaEval(Silently) messages
This PR adds support for quickly executing arbitrary lua functions,
without needing to define a function.

Example:

```lua
xplr.config.modes.builtin.default.key_bindings.on_key["#"] = {
  help = "test",
  messages = {
    { LuaEvalSilently = [[return { { LogInfo = "foo" } }]] },
    { LuaEval = [[return { { LogInfo = io.read() } }]] },
  },
}
```

Partly closes: https://github.com/sayanarijit/xplr/issues/394
2021-11-05 17:01:19 +05:30
Arijit Basu
05c2f7aa68 Support more control over input buffer
This PR adds a new message: `UpdateInputBuffer: InputOperation`

This makes it possible to perform cursor based input operations without
needing input from the keyboard.
2021-11-05 15:12:50 +05:30
Arijit Basu
b45a553a0c Add more keyboard input handlers
This PR adds 3 more keyboard input handlers:

- on_alphanumeric
- on_character
- on_navigation

Also updates documentation.
2021-11-05 13:59:26 +05:30
Arijit Basu
ca6cefb1c1 Use tui-input to handle input buffer
New message: `UpdateInputBufferFromKey` to replace most
`BufferInputFromKey` usage.

This adds more functionalities to the input buffer and reduces
boilerplate code.

This commit also deprecates `config.general.cursor` as the cursor will
be set by the terminal from now.

Repo: https://github.com/sayanarijit/tui-input
2021-11-05 10:20:30 +05:30
Arijit Basu
de6f54f9bd Fix bug with selection 2021-10-30 16:26:11 +05:30
Arijit Basu
a797d7b1c7 Format & lint code 2021-10-30 16:26:11 +05:30
Tom van Dijk
3c8de699ca Fix everything @sayanarijit fed back. 2021-10-30 16:26:11 +05:30
Arijit Basu
4e1580e91f Some cleanups 2021-10-24 11:39:29 +05:30
Shunsuke Mie
41d1385020 Fix a Node type of directory
Fix a issue #364.
2021-10-24 11:39:29 +05:30
Shunsuke Mie
13d046e6ad Move definitions runner related functions
fn runner() and fn from_cli(cli: Cli) util functions are located to
app.rs. However, those are utils for runner. So this commit change the
functions to runner.rs.
2021-10-17 21:11:52 +05:30
Gilad Woloch
402715cdcd Remove trivial ResolvedNode methods 2021-10-06 20:18:11 +05:30
Gilad Woloch
cc022e85ff Fix cargo clippy warnings and reformat 2021-10-06 13:24:56 +05:30
Gilad Woloch
c399236fd3 Reformat 2021-10-06 13:24:56 +05:30
Gilad Woloch
3f0e479f56 Remove trivial methods 2021-10-06 13:24:56 +05:30