sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
11.43k stars 266 forks source link

feat: make backward content visible in input field #1198

Open Xerxes-2 opened 1 week ago

Xerxes-2 commented 1 week ago

Closes https://github.com/sxyazi/yazi/issues/1192.

sxyazi commented 1 week ago

Thanks for the PR!

Why is it limited to only working when going backward? Is it possible to apply it to moving forward as well?

Xerxes-2 commented 1 week ago

Thanks for the PR!

Why is it limited to only working when going backward? Is it possible to apply it to moving forward as well?

Moving forward is a bit tricky, because when you typing, the cursor is also moving forward. ~As for now, implement it for moving backward is the simple choice.~ Implemented

Xerxes-2 commented 5 days ago

Thanks for the PR!

Why is it limited to only working when going backward? Is it possible to apply it to moving forward as well?

It also supports moving forward now.

sxyazi commented 3 days ago

Thanks, I'll give it a thorough test later to see if it affects anything else.

Xerxes-2 commented 3 days ago

Thanks, I'll give it a thorough test later to see if it affects anything else.

Now I've made the offset deterministic, thanks for testing as I don't know how wide it will affect.

sxyazi commented 1 day ago

Hi, I tested it, and it affects the cursor position rendering for CJK characters.

With the patch:

https://github.com/sxyazi/yazi/assets/17523360/00af1e6d-1b74-4b43-bdf8-8679a6c1af25

Previous behavior:

https://github.com/sxyazi/yazi/assets/17523360/d946cb6e-4ba3-4d8c-8293-5b017fa499d2

Test filename: ddfa36dc-361a-11ef-9454-鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅呃呃呃呃鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅0242ac120002-e3e8ed04-361a-11ef-9454-0242ac120002

Xerxes-2 commented 1 day ago

Hi, I tested it, and it affects the cursor position rendering for CJK characters.

With the patch:

screenshot-001061.mp4 Previous behavior:

screenshot-001063.mp4 Test filename: ddfa36dc-361a-11ef-9454-鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅呃呃呃呃鹅鹅鹅鹅鹅鹅鹅鹅鹅鹅0242ac120002-e3e8ed04-361a-11ef-9454-0242ac120002

Now CJK should work