Repository navigation
Conversation
With "use_os_color_picker" on, the picker call blocked the plugin host's main thread until the native dialog closed, so Sublime showed "Not Responding" for as long as the dialog stayed open (125 s in one test on Windows) and every other package in the same plugin host stopped with it. Run the dialog on a worker thread and hand the result back with sublime.set_timeout. Because the editor now stays usable while the dialog is open, remember where the picker was started (a hidden region that follows edits) and put the result there afterwards: back in the original view, with the original selection, or nowhere if that view was closed. Each invocation uses its own region key, and a second request while a dialog is open only shows a status message. Tested with the stock release as baseline (freeze reproduced and fixed) on Windows and with kcolorchooser under WSL: OK and Cancel, edits and a moved caret while the dialog is open, switching tabs, closing the file, plugin reload and package unload with the dialog open, overlapping dialogs, and the built-in picker (use_os_color_picker false) unchanged. macOS is untested. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QrLXeSos7CbhMgJJponrpj
The picker now runs on a worker thread, so an exception there no longer reaches the main thread and was swallowed. Print the traceback to the console and show a status-bar message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TUDTsjkUebDhyzXUW1bYjj
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude reports: this is #284 again. That PR was closed by accident when my fork was deleted; the change is the same, rebased on the current master (the diff is identical, one file, +70 -11).
The native color picker (ChooseColorW on Windows, osascript on Mac, kcolorchooser on Linux) blocks until the dialog closes. While it was open, the plugin host froze. This runs the picker on a worker thread and returns the result on the main thread. The result goes back to the colour that was selected when the picker started, even if the cursor moved or the text changed meanwhile. A second request while a dialog is open is ignored with a status-bar message. Only ch_panel.py changes. Discussion #283.
Tested again after the rebase, on Windows with Sublime Text 4215 (Python 3.14 host):
Tested on the first push of this change (#284; the code is the same apart from the error message commit):
#336699to#c86699, other lines untouched), also after text was inserted before the target and the caret moved; switching tab while the dialog is open; plugin reloaded while the dialog is open (the result still arrives); Sublime quit with the dialog open (the plugin host and the dialog are both gone, no orphan processes); two overlapping dialogs after a reload, each result at its own target; a second window open; one and several cursors.kcolorchooser): the picker runs on the worker thread and Sublime stays responsive (edits while the dialog is open); the dialog starts on the selected colour; Cancel and OK both return to the original target and the result popup shows the chosen colour (#aa0000).🤖 Generated with Claude Code