Troubleshooting
Editor feels laggy
Usually: one giant doc, an attachment dir that exploded, extension conflicts, or a stale file index.
Symptom
You can feel the lag between keystroke and character (200ms+); scrolling a long note tears or drops frames; the CPU fan spins up; occasionally a "double character" — pressing a once produces aa.
Lag is a symptom, not a cause. The Kition editor uses a ProseMirror-based render pipeline that handles tens of thousands of words at 60fps with no sweat. Once it lags, something has blown past the design envelope.
Likely causes
- A single doc over 50K characters (especially with lots of wikilinks / embedded images)
- Attachments folder (default
.attachments/) with > 1000 files in a single level - Multiple extensions installed, one of which subscribes to
onDocChangeand runs on every keystroke - File index is rebuilding (first open of a large vault, or just after renaming / moving many files)
- OS-level IME candidate window competing for focus (common with Chinese input methods)
- A background Agent is mid-tool-call, holding the sidecar main thread
Step-by-step diagnostic
- Bottom-right status bar — does it say "Indexing..."? Wait until it clears
Cmd/Ctrl + Shift + P→ "Show editor stats" for doc length, wikilink count, render time- Check attachments dir size:
ls -l .attachments | wc -l - Settings → Extensions → disable all and retry (isolate extension suspicion)
- Close the Agent panel and retry — isolates Agent / sidecar suspicion
- On macOS, Activity Monitor → watch the CPU of "Kition Helper (Renderer)"
Fix
- Split large docs: anything > 50K chars, slice by H1 and link with wikilinks
- Sub-folder a flat attachments dir:
.attachments/2026-06/ - Disable suspect extensions and re-enable one by one to find the culprit
- Force re-render:
Cmd/Ctrl + Shift + R(does not lose unsaved content, just rebuilds the DOM) - IME focus battle: in OS input settings, set the candidate window to "Below cursor"
Cmd/Ctrl + Shift + P→ "Rebuild file index" to force a fresh index
Diagnostic commands
# Find the heaviest docs in your vault
find . -name "*.md" -type f -exec wc -c {} + | sort -rn | head -10
# Count attachments per folder
find .attachments -type d -exec sh -c 'echo "$(ls -1 "$1" | wc -l)\t$1"' _ {} \; | sort -rn | head -10
# macOS: profile renderer CPU for 10 seconds
sample "Kition Helper (Renderer)" 10 -file /tmp/kition-renderer.txtWorkaround
On a giant doc, switch to "Source mode" (Cmd/Ctrl + .) — it bypasses rich rendering, edits raw Markdown, and stays smooth at hundreds of thousands of characters. The trade-off: no live preview.
You can also disable live wikilink resolution: Settings → Editor → Live wikilink resolution → off. Open is faster, but hover preview is gone.
When to file a bug
- Empty doc, no extensions, Agent closed — still laggy
- CPU < 10% but typing still lags (rules out compute bottleneck, points at event flow)
- The "double character" bug still happens after every IME is disabled
- Render stats show
paint > 200mswith the doc under 10K characters