Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save modified file when dragged to a new window #1791

Closed
crossinghoods opened this issue Jul 14, 2021 · 3 comments · Fixed by #1852
Closed

Unable to save modified file when dragged to a new window #1791

crossinghoods opened this issue Jul 14, 2021 · 3 comments · Fixed by #1852
Labels
sublime issue Issues related to shortcomings or bugs in the ST API

Comments

@crossinghoods
Copy link

Description
Editing typescript project, dragged a tab out to a separate window then modified some lines and tried to save. Sublime won't save unless I drag the tab back into the open project. (see sublime issue - sublimehq/sublime_text#4623)

Steps to reproduce
Start Sublime Text, open a directory containing typescript files. (make sure to have the LSP plugin installed)
open multiple files in tabs
drag one of the tabs out to a separate window
modify the tab that's been dragged out, then try to save
Expected behavior
Expect the separate window/modified file to save.

Actual behavior
125587999-89de6ff6-454e-4746-ba01-375f066a4c3b

The separate window doesn't save with cmd+s (can still see the modified indication on top (circle icon/symbol)

Environment
Sublime Build: 4112
Operating system and version: macOS 11.4,

@rwols rwols added the bug label Jul 14, 2021
@rwols rwols changed the title Unable to save modified file Unable to save modified file when dragged to a new window Jul 14, 2021
@rwols rwols added sublime issue Issues related to shortcomings or bugs in the ST API and removed bug labels Jul 14, 2021
@rchl
Copy link
Member

rchl commented Jul 14, 2021

Created ST core issue for the root issue causing this: sublimehq/sublime_text#4630

@rwols
Copy link
Member

rwols commented Jul 14, 2021

Closing because it seems to be a core issue. See sublimehq/sublime_text#4630

@rwols rwols closed this as completed Jul 14, 2021
@jwortmann
Copy link
Member

jwortmann commented Sep 1, 2021

I also encounter this annoying bug regularly. When it happens you either need to move the tab back to its original window, or save via the menu entry "File > Save".
Another workaround is to disable the Code-Actions-On-Save via a user keybinding:

[
    { "keys": ["primary+s"], "command": "save", "args": {"async": true}, "context": [{"key": "lsp.session_with_capability", "operator": "equal", "operand": "textDocumentSync.willSave | textDocumentSync.willSaveWaitUntil | codeActionProvider.codeActionKinds | documentFormattingProvider | documentRangeFormattingProvider"}] },
]

Even if the actual cause is a ST bug, I wouldn't close and ignore this issue here, and argue that the lsp_save command should not be used in the way as it is now, until the upstream bug gets fixed. So I would even suggest to comment out the lsp_save keybinding by default and let users enable it "at their own risk". Or maybe might there be another way to circumvent the upstream bug to make it work without this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sublime issue Issues related to shortcomings or bugs in the ST API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants