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

WIP: Make visible cursor in search field move with index (fix #92) #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukeflo
Copy link

@lukeflo lukeflo commented Oct 25, 2024

Description of change

I made the visible cursor move with the index of the current search pattern using the visual_cursor() and visual_scroll method of the tui_input crate. It works now, but the cursor still hides the underlaying character. Maybe the order of the inner render functions for each tab has to be changed (at least that worked in my own tui app). But your rendering code is quite complex and I hadn't the time to skim through all details.

Though, I still hope this WIP PR helps with the issue.

Copy link

codecov bot commented Oct 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 3.32%. Comparing base (c6e20e5) to head (bac80a6).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/tui/ui.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main     #93      +/-   ##
========================================
+ Coverage   3.31%   3.32%   +0.01%     
========================================
  Files         19      19              
  Lines       2417    2414       -3     
========================================
  Hits          80      80              
+ Misses      2337    2334       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orhun
Copy link
Owner

orhun commented Oct 26, 2024

Thanks for the PR! It looks good to me.

It works now, but the cursor still hides the underlaying character.

Yeah, I took a quick look and couldn't figure out what's wrong. FWIW, I did a similar implementation in systeroid-tui and it was working fine.

Maybe the order of the inner render functions for each tab has to be changed (at least that worked in my own tui app).

I'm not sure how that's related, can you explain a bit more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants