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