mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-21 03:34:54 +00:00
Remove maximum length config options + don't localize config parse error
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -18,9 +18,9 @@ const Message = struct {
|
||||
|
||||
label: MessageLabel,
|
||||
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, max_length: usize) !InfoLine {
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer) InfoLine {
|
||||
return .{
|
||||
.label = try MessageLabel.init(allocator, buffer, max_length, drawItem),
|
||||
.label = MessageLabel.init(allocator, buffer, drawItem),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ pub const Entry = struct { @"Desktop Entry": DesktopEntry = .{} };
|
||||
label: EnvironmentLabel,
|
||||
lang: Lang,
|
||||
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, max_length: usize, lang: Lang) !Session {
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, lang: Lang) Session {
|
||||
return .{
|
||||
.label = try EnvironmentLabel.init(allocator, buffer, max_length, drawItem),
|
||||
.label = EnvironmentLabel.init(allocator, buffer, drawItem),
|
||||
.lang = lang,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ y: usize,
|
||||
masked: bool,
|
||||
maybe_mask: ?u8,
|
||||
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, max_length: usize, masked: bool, maybe_mask: ?u8) !Text {
|
||||
const text = try DynamicString.initCapacity(allocator, max_length);
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, masked: bool, maybe_mask: ?u8) Text {
|
||||
const text = DynamicString.init(allocator);
|
||||
|
||||
return .{
|
||||
.allocator = allocator,
|
||||
|
||||
@@ -23,11 +23,11 @@ pub fn CyclableLabel(comptime ItemType: type) type {
|
||||
first_char_x: usize,
|
||||
draw_item_fn: DrawItemFn,
|
||||
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, max_length: usize, draw_item_fn: DrawItemFn) !Self {
|
||||
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, draw_item_fn: DrawItemFn) Self {
|
||||
return .{
|
||||
.allocator = allocator,
|
||||
.buffer = buffer,
|
||||
.list = try ItemList.initCapacity(allocator, max_length),
|
||||
.list = ItemList.init(allocator),
|
||||
.current = 0,
|
||||
.visible_length = 0,
|
||||
.x = 0,
|
||||
|
||||
Reference in New Issue
Block a user