Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.21.8 #716

Merged
merged 30 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d5217f6
cargo: Revert version update on `ansi-to-tui` (#702)
har7an Mar 26, 2024
7c6dffc
cargo: allow building with system lua (#703)
nekopsykose Apr 6, 2024
e834242
Adds vim-like scrolling
ElSamhaa Apr 7, 2024
01606e0
Adds corresponding config setting for vimlike_scrolling
ElSamhaa Apr 7, 2024
4aa367c
Makes the current_focus field private to limit usage to its setters a…
ElSamhaa Apr 7, 2024
8780550
Refactors the calc_skipped_rows function to make it more readable
ElSamhaa Apr 7, 2024
fd40de2
Adds tests for the ScrollState calc_skipped_rows fn
ElSamhaa Apr 7, 2024
a6fb695
Refactors the calc_skipped_rows function to make it even more readable
ElSamhaa Apr 7, 2024
5240b39
Rolls back changes to the open terminal file
ElSamhaa Apr 7, 2024
95621af
Increases the preview_cushion to 5 like in vim
ElSamhaa Apr 8, 2024
00bd54a
Removes unnecessary mut from the calc_skipped_rows fn
ElSamhaa Apr 8, 2024
91276f6
Removes an unnecessary condition
ElSamhaa Apr 8, 2024
2a3d056
Clarifies some comments
ElSamhaa Apr 8, 2024
1600ad9
Makes the preview cushion dynamic now, and sets an initial value 5 fo…
ElSamhaa Apr 8, 2024
96ffe86
Fix ScrollUpHalf
sayanarijit Apr 10, 2024
96da7e1
Fix linting
sayanarijit Apr 10, 2024
976530b
Gen docs
sayanarijit Apr 10, 2024
c1bb251
Adds Vim-Like Scrolling to XPLR (#704)
sayanarijit Apr 10, 2024
6fb0781
xplr.util.lscolor shouldn't return nil
sayanarijit May 1, 2024
ce52bcd
Revert vimlike scrolling
sayanarijit May 1, 2024
90df0a2
vimlike_scrolling -> paginated_scrolling
sayanarijit May 1, 2024
6d7ccce
Pass scrolltop in custom Lua function
sayanarijit May 1, 2024
c2a1105
Add yazi an alternative
sayanarijit May 1, 2024
ad8afa9
Update deps
sayanarijit May 1, 2024
a48dae0
Fix node type resolution
abhinavnatarajan May 3, 2024
8afdf9e
Fix node type resolution (#714)
sayanarijit May 3, 2024
e15c1e8
Lock ratatui
sayanarijit May 3, 2024
89d7bcc
Update docs
sayanarijit May 5, 2024
41648ce
Linting fixes
sayanarijit May 5, 2024
805e159
Fix vim scrolling
sayanarijit May 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
301 changes: 152 additions & 149 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ path = './benches/criterion.rs'

[package]
name = 'xplr'
version = '0.21.7'
version = '0.21.8'
authors = ['Arijit Basu <hi@arijitbasu.in>']
edition = '2021'
description = 'A hackable, minimal, fast TUI file explorer'
Expand All @@ -28,7 +28,7 @@ natord = "1.0.9"
anyhow = "1.0.81"
serde_yaml = "0.9.33"
crossterm = { version = "0.27.0", features = [], default-features = false }
ansi-to-tui = "4.0.1"
ansi-to-tui = "3.1.0"
regex = "1.10.3"
gethostname = "0.4.3"
serde_json = "1.0.114"
Expand Down Expand Up @@ -57,7 +57,7 @@ version = "2.0.4"
default-features = false

[dependencies.tui]
version = "0.26.1"
version = "=0.26.1" # https://github.com/ratatui-org/ratatui/issues/1032
default-features = false
features = ['crossterm', 'serde']
package = 'ratatui'
Expand All @@ -73,7 +73,7 @@ features = ['serde']

[dependencies.mlua]
version = "0.9.6"
features = ['luajit', 'vendored', 'serialize', 'send']
features = ['luajit', 'serialize', 'send']

[dependencies.tui-input]
version = "0.8.0"
Expand All @@ -90,5 +90,5 @@ panic = 'abort'
strip = true

[features]


default = ["vendored-lua"]
vendored-lua = ["mlua/vendored"]
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ A hackable, minimal, fast TUI file explorer
<img src="https://img.shields.io/crates/v/xplr.svg" />
</a>

<a href="https://github.com/sayanarijit/xplr/commits">
<img src="https://img.shields.io/github/commit-activity/m/sayanarijit/xplr" />
</a>

<a href="https://matrix.to/#/#xplr-pub:matrix.org">
<img alt="Matrix" src="https://img.shields.io/matrix/xplr-pub:matrix.org?color=0DB787&label=matrix&logo=Matrix">
</a>

<a href="https://discord.gg/JmasSPCcz3">
<img src="https://img.shields.io/discord/834369918312382485?color=5865F2&label=discord&logo=Discord" />
</a>

</p>

<p align="center">
Expand All @@ -38,7 +26,6 @@ https://user-images.githubusercontent.com/11632726/166747867-8a4573f2-cb2f-43a6-
[<a href="https://xplr.dev/en/awesome-hacks">Hacks</a>]
[<a href="https://xplr.dev/en/awesome-plugins">Plugins</a>]
[<a href="https://xplr.dev/en/awesome-integrations">Integrations</a>]
[<a href="https://xplr.dev/en/community">Community</a>]
</h3>

xplr is a terminal UI based file explorer that aims to increase our terminal
Expand All @@ -60,7 +47,7 @@ integration][15], enabling you to achieve insane terminal productivity.

- [[Article] What is a TUI file explorer & why would you need one? ~ xplr.stck.me](https://xplr.stck.me/post/25252/What-is-a-TUI-file-explorer-why-would-you-need-one)

- [[Article] FOSSPicks - Linux Magazine](https://www.linux-magazine.com/Issues/2022/258/FOSSPicks/(offset)/6)
- [[Article] FOSSPicks - Linux Magazine](<https://www.linux-magazine.com/Issues/2022/258/FOSSPicks/(offset)/6>)

## Packaging

Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
See [install.md](./docs/en/src/install.md#build-from-source)

Note: xplr ships with vendored luajit. If the platform can't compile this,
you need to grep out the feature "vendored" from the "mlua" dependency
specified in [Cargo.toml](./Cargo.toml), and static link luajit yourself.
you need to compile using `--no-default-features` argument to avoid using
vendored luajit, so that you can static link luajit yourself.

# Release

Expand Down
3 changes: 2 additions & 1 deletion benches/criterion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fn draw_benchmark(c: &mut Criterion) {
});

let lua = mlua::Lua::new();
let mut ui = ui::UI::new(&lua);
let mut app =
app::App::create("xplr".into(), None, PWD.into(), &lua, None, [].into())
.expect("failed to create app");
Expand All @@ -121,7 +122,7 @@ fn draw_benchmark(c: &mut Criterion) {

c.bench_function("draw on terminal", |b| {
b.iter(|| {
terminal.draw(|f| ui::draw(f, &app, &lua)).unwrap();
terminal.draw(|f| ui.draw(f, &app)).unwrap();
})
});

Expand Down
4 changes: 0 additions & 4 deletions docs/en/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
- [Awesome Integrations][20]
- [Alternatives][22]
- [Upgrade Guide][23]
- [Community][24]
- [Contribute][25]

[1]: introduction.md
[2]: quickstart.md
Expand All @@ -64,8 +62,6 @@
[20]: awesome-integrations.md
[22]: alternatives.md
[23]: upgrade-guide.md
[24]: community.md
[25]: contribute.md
[26]: column-renderer.md
[27]: key-bindings.md
[28]: configure-key-bindings.md
Expand Down
4 changes: 3 additions & 1 deletion docs/en/src/alternatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ These are the alternative TUI/CLI file managers/explorers you might want to chec
- [clifm][11]
- [clifm][12] (non curses)
- [felix][14]
- [yazi][15]

[add more][13]

Expand All @@ -30,5 +31,6 @@ These are the alternative TUI/CLI file managers/explorers you might want to chec
[10]: https://git.2f30.org/noice/
[11]: https://github.com/pasqu4le/clifm
[12]: https://github.com/leo-arch/clifm
[13]: community.md
[13]: https://github.com/sayanarijit/xplr/edit/dev/docs/en/src/alternatives.md
[14]: https://github.com/kyoheiu/felix
[15]: https://github.com/sxyazi/yazi
3 changes: 1 addition & 2 deletions docs/en/src/awesome-hacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ too small or too niche for a full fledge [plugin][2].

Do you have something cool to share?

[Edit this file][3] or [share them here][4] or [let us know][5].
[Edit this file][3] or [share them here][4].

You can try these hacks by writing them to a file, say `hack.lua` and passing
it to xplr with `--extra-config` or `-C`.
Expand Down Expand Up @@ -526,7 +526,6 @@ xplr.config.modes.builtin.default.key_bindings.on_key.T = {
[2]: plugin.md
[3]: https://github.com/sayanarijit/xplr/edit/main/docs/en/src/awesome-hacks.md
[4]: https://github.com/sayanarijit/xplr/discussions/categories/show-and-tell
[5]: community.md
[6]: https://gifyu.com/image/rGSR
[7]: https://s4.gifyu.com/images/xplr-bookmark.gif
[8]: https://github.com/sayanarijit
Expand Down
12 changes: 0 additions & 12 deletions docs/en/src/community.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/en/src/contribute.md

This file was deleted.

13 changes: 13 additions & 0 deletions docs/en/src/general-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ Set it to `true` if you want to hide all remaps in the help menu.

Type: boolean

#### xplr.config.general.paginated_scrolling

Set it to `true` if you want paginated scrolling.

Type: boolean

#### xplr.config.general.scroll_padding

Set the padding value to the scroll area.
Only applicable when `xplr.config.general.paginated_scrolling = false`.

Type: boolean

#### xplr.config.general.enforce_bounded_index_navigation

Set it to `true` if you want the cursor to stay in the same position when
Expand Down
18 changes: 0 additions & 18 deletions docs/en/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,23 +238,6 @@ cargo build --locked --release --bin xplr
sudo cp target/release/xplr /usr/local/bin/
```

## Android

### [Termux][24]

```bash
pkg install rust make binutils
cargo install --locked xplr

# Run
~/.cargo/bin/xplr
```

> Please note that xplr isn't heavily tested on Termux, hence things might need
> a little tweaking and fixing for a smooth user experience.

![termux demo][23]

[1]: #direct-download
[2]: #from-cratesio
[3]: #build-from-source
Expand All @@ -278,7 +261,6 @@ cargo install --locked xplr
[21]: https://www.gnu.org/software/make/
[22]: https://git-scm.com/
[23]: https://github.com/sayanarijit/xplr/assets/11632726/3b61e8c8-76f0-48e8-8734-50e9e7e495b7
[24]: https://termux.dev/
[25]: https://gifyu.com/image/tF2D
[26]: https://github.com/sayanarijit/xplr/releases/latest/download/xplr-linux-musl.tar.gz
[27]: https://pkgs.alpinelinux.org/packages?name=xplr
Expand Down
3 changes: 0 additions & 3 deletions docs/en/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ Some of the coolest features xplr provide beside the basic stuff:
(`:` `q` `s`).
- Quit with failure (`ctrl-c`).

**Q.** What features should be added here? [let us know][20].

[1]: layouts.md
[2]: configure-key-bindings.md
[3]: awesome-plugins.md
Expand All @@ -105,6 +103,5 @@ Some of the coolest features xplr provide beside the basic stuff:
[17]: node_types.md
[18]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[19]: messages.md#startfifo
[20]: community.md
[21]: messages.md#virtual-root
[22]: configuration.md#hooks
8 changes: 8 additions & 0 deletions docs/en/src/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ It contains the following information:

- [layout_size][37]
- [screen_size][37]
- [scrolltop][57]
- [app][38]

### Size
Expand All @@ -508,6 +509,12 @@ It contains the following information:

Every field is of integer type.

### scrolltop

Type: integer

The start index of the visible nodes in the table.

### app

This is a lightweight version of the [Lua Context][39]. In this context, the
Expand Down Expand Up @@ -587,3 +594,4 @@ Hence, only the following fields are available.
[54]: borders.md#border-type
[55]: #customlayout
[56]: sum-type.md
[57]: #scrolltop
6 changes: 0 additions & 6 deletions docs/en/src/sum-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,7 @@ And then we'd go on documenting whatever `Layout Config` is.
So, there you go. This is exactly what sum types are - glorified enums that can
have nested types in each branch.

---

If you're still confused about something, or if you found an error in this
explanation, feel free to [discuss together][5].

[1]: https://en.wikipedia.org/wiki/Tagged_union
[2]: layout.md
[3]: message.md
[4]: style.md#color
[5]: community.md
14 changes: 9 additions & 5 deletions docs/en/src/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ compatibility.

### Instructions

#### [v0.20.2][48] -> [v0.21.7][49]
#### [v0.20.2][48] -> [v0.21.8][49]

- Some plugins might stop rendering colors. Wait for them to update.
- Rename `xplr.config.general.sort_and_filter_ui.search_identifier` to
Expand Down Expand Up @@ -127,6 +127,13 @@ compatibility.
- You can use `c` and `m` keys in default mode to quickly copy
and move focused or selected files, without having to change directory.
- Use `xplr.util.debug()` to debug lua values.
- Since v0.21.8:
- Scroll behavior will default to vim-like continuous scrolling. You can set
`xplr.config.general.paginated_scrolling = true` to revert back to the
paginated scrolling.
- Set `xplr.config.general.scroll_padding` to customize the scroll padding.
- The calculated `scrolltop` value will be passed as part of the
`Content Rendeder Argument` in `Dynamic` layout renderer functions.

Thanks to @noahmayr for contributing to a major part of this release.

Expand Down Expand Up @@ -214,8 +221,6 @@ Thanks to @noahmayr for contributing to a major part of this release.
- ScrollUpHalf ---- {
- ScrollDownHalf -- }

<sub>Like this project so far? **[Please consider contributing][5]**.</sub>

#### [v0.17.6][45] -> [v0.18.0][46]

- Key binding `f` `r` and `f` `R` will now filter using regex.
Expand Down Expand Up @@ -481,7 +486,6 @@ Else do the following:
[2]: https://github.com/sayanarijit/xplr/releases/tag/v0.13.7
[3]: https://github.com/sayanarijit/xplr/releases/tag/v0.14.7
[4]: https://github.com/sayanarijit/xplr/pull/229#issue-662426960
[5]: contribute.md
[6]: https://github.com/sayanarijit/xplr/releases/tag/v0.12.1
[7]: https://docs.rs/xplr/latest/xplr/app/enum.ExternalMsg.html#variant.CallLua
[8]: https://docs.rs/xplr/latest/xplr/app/enum.ExternalMsg.html#variant.CallLuaSilently
Expand Down Expand Up @@ -525,5 +529,5 @@ Else do the following:
[46]: https://github.com/sayanarijit/xplr/releases/tag/v0.18.0
[47]: https://github.com/sayanarijit/xplr/releases/tag/v0.19.4
[48]: https://github.com/sayanarijit/xplr/releases/tag/v0.20.2
[49]: https://github.com/sayanarijit/xplr/releases/tag/v0.21.7
[49]: https://github.com/sayanarijit/xplr/releases/tag/v0.21.8
[50]: https://github.com/lotabout/skim#search-syntax
6 changes: 1 addition & 5 deletions docs/en/src/writing-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ Visit [Awesome Plugins][5] for xplr plugin examples.

- [Tip: A list of hacks yet to make it as Lua plugins][15]
- [Tip: Some UI and themeing tips][12]
- [Tip: A list of handy utility functions][13]
- [Tip: Share tips and tricks working with Lua][14]
- [Tutorial: Adding a New Mode][6]
- [Example: Using Environment Variables and Pipes][7]
- [Example: Using Lua Function Calls][8]
Expand All @@ -92,7 +90,5 @@ Visit [Awesome Plugins][5] for xplr plugin examples.
[10]: column-renderer.md#example-customizing-table-renderer
[11]: layout.md#example-render-a-custom-dynamic-table
[12]: https://github.com/sayanarijit/xplr/discussions/274
[13]: https://github.com/sayanarijit/xplr/discussions/273
[14]: https://github.com/sayanarijit/xplr/discussions/250
[15]: https://github.com/sayanarijit/xplr/wiki/Hacks
[15]: awesome-hacks.md
[16]: https://github.com/sayanarijit/xplr/discussions/529#discussioncomment-4073734
2 changes: 1 addition & 1 deletion docs/en/src/xplr.util.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ xplr.util.to_yaml({ foo = "bar" })
Get a [Style][3] object for the given path based on the LS_COLORS
environment variable.

Type: function( path:string ) -> [Style][3]|nil
Type: function( path:string ) -> [Style][3]

Example:

Expand Down
11 changes: 11 additions & 0 deletions docs/script/deploy-cf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
v="0.4.37"

curl -L https://github.com/rust-lang/mdBook/releases/download/v$v/mdbook-v$v-x86_64-unknown-linux-gnu.tar.gz -o mdbook.tgz \
&& tar xzvf mdbook.tgz \
&& ./mdbook build docs/en \
&& mkdir dist \
&& mv -v docs/en/book/html dist/en \
&& mv -v assets dist \
&& mv -v docs/landing/index.html docs/landing/css docs/landing/js dist \
&& rm -v mdbook \
&& rm -v mdbook.tgz
Loading
Loading