mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-27 16:19:35 -07:00
fix: address fullscreen and n-plus-one review notes
This commit is contained in:
@@ -1955,7 +1955,7 @@ function refreshLinuxVisibleOverlayAfterMpvFullscreenChange(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mainWindow.hide();
|
mainWindow.hide();
|
||||||
mainWindow.show();
|
mainWindow.showInactive();
|
||||||
ensureOverlayWindowLevel(mainWindow);
|
ensureOverlayWindowLevel(mainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user