mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-27 16:49:51 -07:00
fix(launcher): normalize rofi prompt spacing
- Add formatRofiPrompt to trim trailing whitespace and append a single space, keeping the prompt from running into the input field - Apply it across all rofi -p usages in picker.ts and history-command.ts - Add tests for formatRofiPrompt edge cases (empty/whitespace-only prompts)
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
collectVideos,
|
||||
findRofiTheme,
|
||||
formatPickerLaunchError,
|
||||
formatRofiPrompt,
|
||||
showFzfMenu,
|
||||
showRofiMenu,
|
||||
} from '../picker.js';
|
||||
@@ -199,7 +200,16 @@ function showRofiIndexMenu(
|
||||
themePath: string | null,
|
||||
icons: Array<string | null> = [],
|
||||
): number {
|
||||
const rofiArgs = ['-dmenu', '-i', '-matching', 'fuzzy', '-format', 'i', '-p', prompt];
|
||||
const rofiArgs = [
|
||||
'-dmenu',
|
||||
'-i',
|
||||
'-matching',
|
||||
'fuzzy',
|
||||
'-format',
|
||||
'i',
|
||||
'-p',
|
||||
formatRofiPrompt(prompt),
|
||||
];
|
||||
const hasIcons = icons.some(Boolean);
|
||||
if (hasIcons) rofiArgs.push('-show-icons');
|
||||
if (themePath) {
|
||||
|
||||
Reference in New Issue
Block a user