Skip to content

fix(editor): clear command palette in initCommands to avoid stale act… - #252

Open
VDnoob wants to merge 1 commit into
Visual-Code-Space:mainfrom
VDnoob:jeel/crash-fix
Open

fix(editor): clear command palette in initCommands to avoid stale act…#252
VDnoob wants to merge 1 commit into
Visual-Code-Space:mainfrom
VDnoob:jeel/crash-fix

Conversation

@VDnoob

@VDnoob VDnoob commented Apr 11, 2026

Copy link
Copy Markdown

IllegalStateException: Attempting to launch an unregistered ActivityResultLauncher means openFile.launch(...) ran while that ActivityResultLauncher was no longer registered with the activity’s ActivityResultRegistry.

##Fix applied

initCommands() already had a commented-out reset. Turning it on clears the palette when each EditorActivity is created, so old launcher-backed commands are dropped before initCommands() re-registers static commands. FileMenu / drawer / top bar LaunchedEffects then register fresh handlers with the current launchers. Plugins still call addCommand after load as before.

Change: call CommandPaletteManager.instance.clear() at the start of initCommands() in EditorActivity.kt.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a state management issue where command registrations from previous editor sessions could persist and execute unexpectedly in new sessions, ensuring the editor starts with a clean state each time.

@Visual-Code-Space Visual-Code-Space deleted a comment from coderabbitai Bot Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant