Skip to content

Conversation

@otomist
Copy link
Contributor

@otomist otomist commented Dec 1, 2025

This PR addresses: #96 and adds a visual cursor to the password area.

cursor_demo.mp4

Note: I manually calculate the cursor x position + padding. I couldn't see a easy way to use ratatui's center function because the cursor isn't a widget. I'm not super familiar with ratatui though so if there's a better way I can look into it.

@otomist
Copy link
Contributor Author

otomist commented Dec 1, 2025

Increased the password field width so this should now resolve #98 as well. @pythops


let inner_width = passkey_area.width.saturating_sub(2) as usize;
let pad_left = if inner_width > pass_len {
(inner_width - pass_len) / 2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use saturating_sub here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 safety first. Should be fixed!

@pythops pythops merged commit 07df173 into pythops:main Dec 1, 2025
1 check passed
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