fix: address fullscreen and n-plus-one review notes

This commit is contained in:
2026-04-26 19:34:31 -07:00
parent ab41837d3d
commit c150fce782
3 changed files with 11 additions and 4 deletions

View File

@@ -1955,7 +1955,7 @@ function refreshLinuxVisibleOverlayAfterMpvFullscreenChange(): void {
} }
mainWindow.hide(); mainWindow.hide();
mainWindow.show(); mainWindow.showInactive();
ensureOverlayWindowLevel(mainWindow); ensureOverlayWindowLevel(mainWindow);
} }

View File

@@ -394,6 +394,9 @@ export function markNPlusOneTargets(
return []; return [];
} }
const normalizedSourceText =
typeof sourceText === 'string' ? sourceText.replace(/\r?\n/g, ' ').trim() : undefined;
const markedTokens = tokens.map((token) => ({ const markedTokens = tokens.map((token) => ({
...token, ...token,
isNPlusOneTarget: false, isNPlusOneTarget: false,
@@ -431,7 +434,7 @@ export function markNPlusOneTargets(
for (let i = 0; i < markedTokens.length; i++) { for (let i = 0; i < markedTokens.length; i++) {
const token = markedTokens[i]; const token = markedTokens[i];
if (!token) continue; if (!token) continue;
if (hasSentenceBoundaryInSourceGap(sourceText, previousTokenEnd, token.startPos)) { if (hasSentenceBoundaryInSourceGap(normalizedSourceText, previousTokenEnd, token.startPos)) {
markSentence(sentenceStart, i); markSentence(sentenceStart, i);
sentenceStart = i; sentenceStart = i;
} }

View File

@@ -353,8 +353,12 @@ export class HyprlandWindowTracker extends BaseWindowTracker {
return null; return null;
} }
const output = execSync('hyprctl -j monitors', { encoding: 'utf-8' }); try {
return parseHyprctlMonitors(output); const output = execSync('hyprctl -j monitors', { encoding: 'utf-8' });
return parseHyprctlMonitors(output);
} catch {
return null;
}
} }
private getWindowCommandLine(pid: number): string | null { private getWindowCommandLine(pid: number): string | null {