mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-21 11:44:55 +00:00
Various bug fixes and small features (#606)
* Fix stray cursor, integer overflows and other bugs * check for getenvlist error, shorten code * fix cascade, set info_line before auth, make code clearer and a bug fix * Add option to turn on numlock at startup * Fix setting numlock * Update build.zig * Custom info text * Shift+Tab for previous input * update changelog and res/config * Some fixes * update build.zig * update build.zig again * Fix xauth command for some shells and fix building in ReleaseSafe * Use git describe to get dev version str * revert change to getLockState (it broke the doom animation) * add new ly error messages. Only try to make path for pam/exe during install when dest_directory is defined + print warning on error. * add warning message for workaround
This commit is contained in:
@@ -78,14 +78,21 @@ pub fn handle(self: *Text, maybe_event: ?*termbox.tb_event, insert_mode: bool) !
|
||||
}
|
||||
}
|
||||
|
||||
termbox.tb_set_cursor(@intCast(self.x + (self.cursor - self.visible_start)), @intCast(self.y));
|
||||
_ = termbox.tb_set_cursor(@intCast(self.x + (self.cursor - self.visible_start)), @intCast(self.y));
|
||||
}
|
||||
|
||||
pub fn draw(self: Text) void {
|
||||
const length = @min(self.text.items.len, self.visible_length);
|
||||
if (length == 0) return;
|
||||
|
||||
const visible_slice = if (self.text.items.len > self.visible_length and self.cursor < self.text.items.len) self.text.items[self.visible_start..(self.visible_length + self.visible_start)] else self.text.items[self.visible_start..];
|
||||
const visible_slice = vs: {
|
||||
if (self.text.items.len > self.visible_length and self.cursor < self.text.items.len) {
|
||||
break :vs self.text.items[self.visible_start..(self.visible_length + self.visible_start)];
|
||||
} else {
|
||||
break :vs self.text.items[self.visible_start..];
|
||||
}
|
||||
};
|
||||
|
||||
self.buffer.drawLabel(visible_slice, self.x, self.y);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user