Arijit Basu
bfd403c894
Upgrade version
3 years ago
Arijit Basu
3d81a49cec
Auto generate messages docs
...
- Huge refactor.
- Run `python docs/script/generate.py` to generate `docs/en/src/messages.md`.
3 years ago
Arijit Basu
67eca1ecdf
More doc fixes
3 years ago
Arijit Basu
8385b92661
Minor doc improvements
3 years ago
Arijit Basu
ca211bb073
Auto generate some API docs from init.lua
...
This is the beginning of the xplr documentation revolution.
Closes: https://github.com/sayanarijit/xplr/issues/445
3 years ago
Arijit Basu
ecc59b1d9d
Option to configure wrapping on move
...
Closes: https://github.com/sayanarijit/xplr/issues/441
3 years ago
Arijit Basu
618ade53ec
Document init.lua
...
Ref: https://github.com/sayanarijit/xplr/issues/445
3 years ago
Arijit Basu
721ffd0216
Support custom `border_type` and `border_style`
...
This adds support for defining custom border types and border styles.
Example:
```
xplr.config.general.panel_ui.default.border_type = "Thick"
xplr.config.general.panel_ui.default.border_style.fg = "Black"
xplr.config.general.panel_ui.default.border_style.bg = "Gray"
```
Closes: https://github.com/sayanarijit/xplr/issues/448
3 years ago
Arijit Basu
087f3b0d52
Version 0.17.2
3 years ago
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".
3 years ago
Arijit Basu
e6ea983a8a
Add "duplicate as"
...
Closes https://github.com/sayanarijit/xplr/issues/434
3 years ago
Arijit Basu
e2c3251736
Fix focus when creating files in non-$PWD location
3 years ago
Arijit Basu
4ff11c2ef4
Upgrade version
3 years ago
Arijit Basu
24bd6d9f00
Merge the pending changes from #429
3 years ago
Arijit Basu
729b51d674
Create parent directories before creating the file
3 years ago
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.
3 years ago
Arijit Basu
cdd60eef4c
Format init.lua consistently
3 years ago
Arijit Basu
c89d5a45f1
Fix NixOS tests
3 years ago
Arijit Basu
3142cdd3ec
Upgrade version
3 years ago
Arijit Basu
7b9e4deff5
Support passing argument to `LuaEval` and `LuaEvalSilently`
...
If the argument of `LuaEval` evaluates to a function, xplr will try to
pass Lua Context to it.
Example:
```lua
{ LuaEval = [[function(app) return { { LogInfo = app.pwd } } end]] }
```
Closes: https://github.com/sayanarijit/xplr/issues/394
3 years ago
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
3 years ago
Arijit Basu
b7d86ae1ec
Serialize None to nil
...
Fixes: https://github.com/sayanarijit/xplr/issues/417
3 years ago
Tom van Dijk
b1ac4944ab
`help_hide_remaps` -> `hide_remaps_in_help_menu`
3 years ago
Tom van Dijk
263eb5943a
Introduce `general.help_hide_remaps` config entry.
3 years ago
Arijit Basu
def98de9b3
Upgrade version
3 years ago
Arijit Basu
5b710070a3
Optimize more
3 years ago
Arijit Basu
41c387542f
Fix auto jumping on cursor when visiting large dir
3 years ago
Arijit Basu
7c7351c2e8
Optimize optimization hack
3 years ago
Arijit Basu
5211e4fa40
Fix Lua API performance by caching
...
Fixes: https://github.com/sayanarijit/xplr/issues/412
3 years ago
Arijit Basu
132b528a5d
Remove trailing `.` in the CLI help menu
3 years ago
Arijit Basu
d2c5f49835
Fix CD (try again)
3 years ago
Arijit Basu
296d93a81a
Fix linux gnu bin release
3 years ago
Arijit Basu
605b2bc391
Fix CD for musl
3 years ago
Arijit Basu
9d088239ea
Upgrade to 0.16.0
3 years ago
Arijit Basu
24637449a3
Improve CLI help
3 years ago
Arijit Basu
f78d9e99fd
Remove debug statement and add tests
3 years ago
Arijit Basu
8e00b3e658
Add scroll for the input buffer
3 years ago
Arijit Basu
b0c91a954e
Improve update_input_buffer
3 years ago
Arijit Basu
074217f21e
Fix issue with input buffer
3 years ago
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.
3 years ago
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
3 years ago
Arijit Basu
165d992b75
Fix logs UI
...
Fixes: https://github.com/sayanarijit/xplr/issues/396
3 years ago
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.
3 years ago
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.
3 years ago
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
3 years ago
Shunsuke Mie
f5131b08ab
Change to use `PWD` env vairable to get current dir
...
Fixes 285.
3 years ago
Arijit Basu
00030e44ff
Fail if path doesn't exist
3 years ago
Arijit Basu
de6f54f9bd
Fix bug with selection
3 years ago
Arijit Basu
a797d7b1c7
Format & lint code
3 years ago
Arijit Basu
2d7158afc0
Implement support path selection and force focus
...
Examples:
```bash
xplr $PWD /path/to/select1 path/to/select2
xplr -- $PWD /path/to/select1 path/to/select2
echo -e "$PWD\n/path/to/select1\npath/to/select2" | xplr -
ls -d /path/to/select1 path/to/select2 | xplr $PWD -
```
3 years ago
Arijit Basu
91675e28af
Some cleanup
3 years ago
Tom van Dijk
102832c65c
Fix suggestions and run clippy
3 years ago
Tom van Dijk
44f05c6e4b
Implement --force-focus
3 years ago
Tom van Dijk
3c8de699ca
Fix everything @sayanarijit fed back.
3 years ago
Tom van Dijk
cbb244f9a0
Implement --select
3 years ago
Shunsuke Mie
05fb583f98
Add a test for pwd_watcher
3 years ago
Shunsuke Mie
c5f60951f7
Add tests for explorer
...
The comment outed test fails randomly. Change the recusive function
before enableing the test.
3 years ago
Shunsuke Mie
1947d77a33
Change mods name for tests
...
There are two mod names for test, `test` and `tests`. This commit unites
the name to `tests`. It is commonly used.
3 years ago
Arijit Basu
4e1580e91f
Some cleanups
3 years ago
Shunsuke Mie
41d1385020
Fix a Node type of directory
...
Fix a issue #364 .
3 years ago
Arijit Basu
66f5acc482
Fix criterion test
3 years ago
Arijit Basu
3ec870739c
Bump version
3 years ago
Arijit Basu
0328eb63c7
Fix selection count
...
Fixes https://github.com/sayanarijit/xplr/issues/363
3 years ago
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.
3 years ago
Arijit Basu
347b9625aa
Add padding to custom content titles
3 years ago
Gilad Woloch
402715cdcd
Remove trivial `ResolvedNode` methods
3 years ago
Gilad Woloch
95b580203f
Introduce `xor` helper
3 years ago
Gilad Woloch
18b784f054
Correct typo
3 years ago
Gilad Woloch
2ef7523bb0
Derive `PartialEq`
3 years ago
Gilad Woloch
46287f6373
Use `Result::is_ok`
3 years ago
Gilad Woloch
45ad449eb3
Avoid unnecessary lambda
3 years ago
Gilad Woloch
a2343c05ca
Correct `clippy` error
3 years ago
Gilad Woloch
cc022e85ff
Fix `cargo clippy` warnings and reformat
3 years ago
Gilad Woloch
c399236fd3
Reformat
3 years ago
Gilad Woloch
3f0e479f56
Remove trivial methods
3 years ago
Arijit Basu
9982a205db
Downgrade version for the docs
...
Upgrade version when just before making a new release, else the doc will
link to invalid release.
3 years ago
Arijit Basu
bec80e98df
Improve input reading by eliminating pause
...
Stop the thread instead of pausing it. This improves the CPU usage and
responsiveness a slightly.
3 years ago
Gilad Woloch
ac1b40799a
Apply `rustfmt`
3 years ago
Gilad Woloch
394c09ae87
Merge normal/reversed cases in `NodeSorterApplicable::apply`
3 years ago
Arijit Basu
e0c1581a0a
Optimize silent calls
...
Silent calls don't need to pause input reading as they are non
interactive and quickly finish execution.
3 years ago
Arijit Basu
5e96d48135
Major release 0.15.0
3 years ago
Arijit Basu
dd73220ec8
Support switching modes keeping input buffer.
...
Closes: https://github.com/sayanarijit/xplr/issues/303
3 years ago
Arijit Basu
ac1476bc08
Cleanup
3 years ago
Arijit Basu
aee49dad78
Support terminal colors in custom layout
...
Example:
```lua
xplr.config.layouts.builtin.default = {
CustomContent = {
title = "custom title",
body = {
StaticParagraph = { render = "\x1b[31mcustom body\x1b[0m" },
},
},
}
```
3 years ago
Arijit Basu
5eab3c6033
Support defining custom layout for different modes
...
Closes: https://github.com/sayanarijit/xplr/issues/335
3 years ago
Arijit Basu
85cc956792
Fix reading input
...
Wait for confirmation after sending a message to a thread.
Also, use unwrap() to crash and burn than using unwrap_or_default() when
message passing fails.
It's highly unlikely to happen and also trivial to the core logic. But
let's see the error when it does happen.
Fixes https://github.com/sayanarijit/xplr/issues/301
3 years ago
Arijit Basu
5723acc21b
Fix input conversion logic
3 years ago
Arijit Basu
e3150798d9
Disable recover mode by default
...
Closes: https://github.com/sayanarijit/xplr/issues/330
3 years ago
Arijit Basu
14b14bba42
Let's get a hew home - xplr.dev
...
Thanks to your continued support we're getting a new homepage https://xplr.dev
3 years ago
Arijit Basu
696549e2e5
Remove `config` from CallLuaArg
...
The `Config` object is globally available as `xplr.config`, and thus
it's redundant. Config is read only once, when xplr loads.
Closes https://github.com/sayanarijit/xplr/issues/321
3 years ago
Arijit Basu
69d3b3af46
Add focus selection UI
...
Closes: https://github.com/sayanarijit/xplr/issues/322
3 years ago
Arijit Basu
3f668c2d04
Improve runner API
...
Some API improvements on top of #324
3 years ago
Tom van Dijk
671d1b11fd
Refactored parts of `runner::Runner` to take a Cli struct, instead of putting everything manually in `Runner`.
3 years ago
Arijit Basu
1756332e5b
Fallback to tempdir if runtime is inaccessible
...
Fixes: https://github.com/sayanarijit/xplr/issues/319
3 years ago
Arijit Basu
1b1032d0bd
Fix missing config error
...
Do not report error when config file is missing and it's not specified
via CLI args.
3 years ago
Arijit Basu
abc7011f56
Test upgrade guild is up to date.
...
Never miss updating the upgrade guide again
3 years ago
Arijit Basu
7cc8c621ef
Update version
3 years ago
Arijit Basu
61657a70c7
Add support for loading extra config files
...
Use `-C` / `--extra-config` to load Lua files to overwrite the default
or user defined config.
This helps with integration, where integrating xplr with another tool
requires xplr to overwrite some config, without requiring the users to
install an xplr plugin or update the xplr config.
Example:
```bash
xplr -C one.lua two.lua
# Or
xplr -C one.lua -C two.lua
```
> **WARNING:**
>
> Extra config doesn't require specifying the `version`, hence, it's the
> integration author or the user's responsibility to assert
> compatibility using the globally exposed `version` in the extra config
> files, similar to xplr plugins.
Ref: https://github.com/sayanarijit/xplr/issues/316
3 years ago
Arijit Basu
7b2b29b27d
Cleanup - Format Lua code
3 years ago
Arijit Basu
af5a99328f
Update version
3 years ago
Arijit Basu
35c18a25dc
Remove per directory buffer
...
Closes: https://github.com/sayanarijit/xplr/issues/289
3 years ago
Arijit Basu
7d0605479e
Allow dynamic linking to load Lua modules using C
...
Also upgrade packages.
Closes: https://github.com/sayanarijit/xplr/issues/309
3 years ago
Arijit Basu
865d6930db
Use unsafe lua to allow c modules
...
Closes: https://github.com/sayanarijit/xplr/issues/309
3 years ago
Arijit Basu
f1e75caf89
Remove termion dependency
...
Termion is only used to get TTY which is simple enough to implement.
3 years ago
Arijit Basu
9070cd9e17
Add more docs
3 years ago
Arijit Basu
6162744bef
Minor improvements
...
Closes: https://github.com/sayanarijit/xplr/issues/305
3 years ago
Arijit Basu
f5aceb1e66
Make the number of visible logs dynamic
...
It helps to see all the logs when switching to a bigger InputAndLogs
layout.
3 years ago
Arijit Basu
db9c926b0c
Update version
3 years ago
Arijit Basu
b1ce57d68b
Recursively clean session path
...
Fixes: https://github.com/sayanarijit/xplr/issues/293
3 years ago
Arijit Basu
6babfeb3d6
Minor improvements
...
Fixes: https://github.com/sayanarijit/xplr/issues/284
Closes: https://github.com/sayanarijit/xplr/issues/286
Partially fixes: https://github.com/sayanarijit/xplr/issues/285
3 years ago
Arijit Basu
4307ba657a
Fix ToggleSelectionByPath
...
Fixes: https://github.com/sayanarijit/xplr/issues/295
3 years ago
Arijit Basu
d29f6aed6d
Fix StartFifo and ToggleFifo
...
Also add `xplr.config.general.start_fifo`.
Closes: https://github.com/sayanarijit/xplr/issues/280
3 years ago
Arijit Basu
b61bf9dcf2
Increase poll timeout
...
Ref: https://github.com/sayanarijit/xplr/issues/10
3 years ago
Arijit Basu
ed65d85568
Remove auto refresh service
...
Ref: https://github.com/sayanarijit/xplr/issues/10
3 years ago
Arijit Basu
5c6fd1ef63
Update version
3 years ago
Arijit Basu
329821ca1b
Improve FocusNext and FocusPrevious behavior
...
Closes: https://github.com/sayanarijit/xplr/issues/253
3 years ago
Arijit Basu
4d8f1ef2ef
Fix handling of relative paths
...
Closes: https://github.com/sayanarijit/xplr/issues/255
3 years ago
Arijit Basu
f6d1be61d5
Add quit mode and key bindings
...
`:q<enter>` -> Just quit.
`:qp` -> quit printing pwd.
`:qf` -> quit printing focus.
`:qs` -> quit printing selection.
`:qr` -> quit printing result.
Ref: https://github.com/sayanarijit/xplr/issues/257
3 years ago
Arijit Basu
6b03598b5d
Add more quit options
...
Adds the following messages.
- PrintPwdAndQuit
- PrintFocusPathAndQuit
- PrintSelectionAndQuit
Closed: https://github.com/sayanarijit/xplr/issues/257
3 years ago
Arijit Basu
6a70b568bf
Fix FocusPath issue
...
Fixes: https://github.com/sayanarijit/xplr/issues/249
3 years ago
Arijit Basu
f1ffc551fc
Minor addition
3 years ago
Arijit Basu
844480204c
Support specifying read-only mode via CLI argument
...
Closes: https://github.com/sayanarijit/xplr/issues/22
3 years ago
Arijit Basu
f12e1e5290
Fix config path on macOS
...
Also, add `-c` / `--config` CLI option to specify custom config file.
Priority is:
`-c <PATH>` > `~/.config/xplr/init.lua` > `/etc/xplr/init.lua`.
Fixes: https://github.com/sayanarijit/xplr/issues/230
3 years ago
Arijit Basu
1513c325d6
Add option to disable recover mode
...
Use `config.general.disable_recover_mode = true` to disable the recover
mode.
Closes: https://github.com/sayanarijit/xplr/issues/232
3 years ago
Arijit Basu
a2f42ac6fc
Add support for FIFO based previewer
...
Adds basic support for nnn-like FIFO based previewer.
The FIFO can be manager with the following messages:
- StartFifo: /path/to/fifo
- StopFifo
- ToggleFifo: /path/to/fifo
A basic nnn plugin wrapper example:
```lua
-- Usage Example:
--
-- require("nnn_preview_wrapper").setup{
-- plugin_path = os.getenv("HOME") .. "/.config/nnn/plugins/preview-tabbed",
-- fifo_path = "/tmp/xplr.fifo",
-- mode = "action",
-- key = "p",
-- }
--
-- Press `:p` to toggle preview mode.
local function setup(o)
if o.fifo_path == nil then
o.fifo_path = os.getenv("NNN_FIFO")
end
if o.mode == nil then
o.mode = "action"
end
if o.key == nil then
o.key = "p"
end
local enabled = false
local message = nil
os.execute('[ ! -p "' .. o.fifo_path ..'" ] && mkfifo "' .. o.fifo_path .. '"')
xplr.fn.custom.preview_toggle = function(app)
if enabled then
enabled = false
message = "StopFifo"
else
os.execute('NNN_FIFO="' .. o.fifo_path .. '" "'.. o.plugin_path .. '" & ')
enabled = true
message = { StartFifo = o.fifo_path }
end
return { message }
end
xplr.config.modes.builtin[o.mode].key_bindings.on_key[o.key] = {
help = "search with preview",
messages = {
"PopMode",
{ CallLuaSilently = "custom.preview_toggle" },
},
}
end
return { setup = setup }
```
Press `:p` to toggle preview mode.
Closes: https://github.com/sayanarijit/xplr/issues/205
3 years ago
Arijit Basu
2962a8d52d
Further improve the API.
...
This improves the compatibility and adds the ability to introduce
non-breaking changes by using a builder pattern.
Example:
```rust
fn main() {
match xplr::runner(None).and_then(|a| a.run()) {
Ok(Some(out)) => print!("{}", out),
Ok(None) => {}
Err(err) => {
if !err.to_string().is_empty() {
eprintln!("error: {}", err);
};
std::process::exit(1);
}
}
}
```
3 years ago
Arijit Basu
fabcc8e865
Implement CLI arguments
...
Going with custom CLI parsing for minimalism and flexibility.
Closes: https://github.com/sayanarijit/xplr/issues/228
3 years ago
Arijit Basu
a1a1dee4af
Remove --locked
...
Many crates are outdated. One is even yanked. IMO failing build is
better than running with insecure/bad dependencies.
Ref: https://github.com/sayanarijit/xplr/issues/212#issuecomment-855175144
3 years ago
Arijit Basu
9a22c8b423
Fix pgp publishing attempt 4
3 years ago
Arijit Basu
7e35ff42fc
Fix pgp publishing attempt 3
3 years ago
Arijit Basu
6991db8c33
Fix gpg publishing attempt 2
3 years ago
Arijit Basu
c5e97d5bae
Sign releases with pgp
...
Closes: https://github.com/sayanarijit/xplr/issues/131
3 years ago
Arijit Basu
902f20aa83
Fix focus jumping
...
Fixes: https://github.com/sayanarijit/xplr/issues/211
3 years ago
Arijit Basu
36ab821d2c
Upgrade dependencies
...
Closes: https://github.com/sayanarijit/xplr/issues/187
3 years ago
Arijit Basu
7496f5bf8f
Disable mouse by default and bind `:m` to toggle
...
- Make mouse disabled by default.
- Add key binding `:m` to toggle mouse.
Closes: https://github.com/sayanarijit/xplr/issues/206
3 years ago
Arijit Basu
7de0811eaf
No need to "Refresh" explicitly
...
Closes: https://github.com/sayanarijit/xplr/issues/207
3 years ago
Arijit Basu
72a86f8e0e
Polish xplr library API
...
Minor improvements to the xplr library API.
Closes: https://github.com/sayanarijit/xplr/issues/213
3 years ago
Arijit Basu
6412856d73
Improve docs
3 years ago
Arijit Basu
b284124022
Optimize rendering speed by serializing less
...
Serializing to and from Lua value is expensive. Hence, once serialized,
we should reuse the value.
3 years ago
Arijit Basu
fc7d205d92
Improve CallLua and CallLuaSilently
...
Pass a custom table, optimized for convenience and speed.
3 years ago
Arijit Basu
695acf5c1e
Inherit node types config
...
Inherit `node_types` config instead of overwriting it.
Closes: https://github.com/sayanarijit/xplr/issues/200
3 years ago
Arijit Basu
88aedddf53
Fix rustc 1.50 compatibility
3 years ago
Arijit Basu
b4247a7d03
Improve CallLua, mime_essence, permissions
...
Refs:
- https://github.com/sayanarijit/xplr/issues/187
- https://github.com/sayanarijit/xplr/issues/194
- https://github.com/sayanarijit/xplr/issues/195
3 years ago
Arijit Basu
9b02ef3429
Fix "ctrl-i" key for history navigation
...
Unfortunately, "ctrl-i" doesn't work unless "tab" i sremapped to the
key.
3 years ago
Maxim Baz
eef4d92548
Remove extra spaces
3 years ago
Maxim Baz
d51848daf9
Fix typo
3 years ago
Arijit Basu
aa7a441751
Make mode visible in input/logs panel
...
Also, map ":q" to "quit" action.
Ref: https://github.com/sayanarijit/xplr/issues/158
3 years ago
Arijit Basu
db669cdcbf
Remove "remaps:"
...
Remaps has been removed to simplify key bindings. With Lua, it's now
possible to remap using basic assignments.
For e.g.
```Lua
xplr.config.modes.builtin.default.key_bindings.on_key["v"] = xplr.config.modes.builtin.default.key_bindings.on_key.space
```
Help menu will auto detect remapped keys and display after removing the
redundant mappings.
Ref: https://github.com/sayanarijit/xplr/discussions/183#discussioncomment-774159
3 years ago
Arijit Basu
cb695fcaa7
Add colorful permissions
...
Ref: https://github.com/sayanarijit/xplr/issues/187
3 years ago
Arijit Basu
91838f88ce
Fix symlink handling
...
- Broken symlink should display without error.
- Display the symlink destination.
- Fix deleting symlinks pointing to a directory.
Fixes: https://github.com/sayanarijit/xplr/issues/185
3 years ago