Add toggle visibility to password (#938)

## What are the changes about?

I have add a keybinding to toggle the visibility of the password

## What existing issue does this resolve?

N/A

## Pre-requisites

- [x] I have tested & confirmed the changes work locally

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/938
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
Co-authored-by: Luna <luna-39@noreply.codeberg.org>
Co-committed-by: Luna <luna-39@noreply.codeberg.org>
This commit is contained in:
Luna
2026-03-17 12:27:23 +01:00
committed by AnErrupTion
parent 7cefff4570
commit 3a4109eb2d
27 changed files with 66 additions and 3 deletions

View File

@@ -96,6 +96,10 @@ pub fn clear(self: *Text) void {
self.visible_start = 0;
}
pub fn toggleMask(self: *Text) void {
self.masked = !self.masked;
}
pub fn handle(self: *Text, maybe_key: ?keyboard.Key, insert_mode: bool) !void {
if (maybe_key) |key| {
if (key.left or (!insert_mode and (key.h or key.backspace))) {