From 6b56cb83a826f9259e7fc7e0b8a5b4562e413082 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 17 Feb 2023 11:57:34 +0000 Subject: [PATCH] fix for rofi lines issue --- globurrl.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/globurrl.nim b/globurrl.nim index c0ba020..fbc7d16 100644 --- a/globurrl.nim +++ b/globurrl.nim @@ -189,16 +189,18 @@ proc markup(str: string): string = proc genMenuCmd*(data: Info, opts: varargs[string], rofi: bool = false): string = # Build dmenu/rofi command var cmd = "" + var x_lines = len(opts) + 1 # if the text is empty, we don't want to create a menu item of it if data.full_text != "": let text = markup(data.full_text) cmd &= text & "\n" + else: + x_lines -= 1 for opt in opts: let text = markup(opt) cmd = cmd & text & "\n" cmd.removeSuffix("\n") - var x_lines = len(opts) + 1 if x_lines > MAX_LINES: x_lines = MAX_LINES