mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
fix: track vimEnabled changes in status line triggers
When vim mode is toggled off, vimMode stays the same but the status line should stop including vim data. Use effectiveVim (undefined when disabled) as the tracked value instead of raw vimMode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c219f7c4ac
commit
24251db4ef
1 changed files with 6 additions and 5 deletions
|
|
@ -110,14 +110,15 @@ export function useStatusLine(): {
|
|||
// does not fire redundantly on mount.
|
||||
const { lastPromptTokenCount } = uiState.sessionStats;
|
||||
const { currentModel } = uiState;
|
||||
const effectiveVim = vimEnabled ? vimMode : undefined;
|
||||
const prevStateRef = useRef<{
|
||||
promptTokenCount: number;
|
||||
currentModel: string;
|
||||
vimMode: string | undefined;
|
||||
effectiveVim: string | undefined;
|
||||
}>({
|
||||
promptTokenCount: lastPromptTokenCount,
|
||||
currentModel,
|
||||
vimMode,
|
||||
effectiveVim,
|
||||
});
|
||||
|
||||
// Guard: when true, the mount effect has already called doUpdate so the
|
||||
|
|
@ -209,18 +210,18 @@ export function useStatusLine(): {
|
|||
if (
|
||||
lastPromptTokenCount !== prev.promptTokenCount ||
|
||||
currentModel !== prev.currentModel ||
|
||||
vimMode !== prev.vimMode
|
||||
effectiveVim !== prev.effectiveVim
|
||||
) {
|
||||
prev.promptTokenCount = lastPromptTokenCount;
|
||||
prev.currentModel = currentModel;
|
||||
prev.vimMode = vimMode;
|
||||
prev.effectiveVim = effectiveVim;
|
||||
scheduleUpdate();
|
||||
}
|
||||
}, [
|
||||
statusLineCommand,
|
||||
lastPromptTokenCount,
|
||||
currentModel,
|
||||
vimMode,
|
||||
effectiveVim,
|
||||
scheduleUpdate,
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue