Add new behaviors and appearance around deleted files#1588
Draft
savetheclocktower wants to merge 14 commits into
Draft
Add new behaviors and appearance around deleted files#1588savetheclocktower wants to merge 14 commits into
savetheclocktower wants to merge 14 commits into
Conversation
…before deciding how to behave.
…and add support for `deleted` and `conflicted` states. By default, this does nothing cosmetic; UI themes must be updated to hook into these new class names.
…to reflect the “deleted” status of a file.
…named `tabs.enableItemStatusColoring`.
Contributor
Author
|
The |
Contributor
Author
|
Nope, taking out of draft will wait at least a bit longer. Discovered another issue (pulsar-edit/text-buffer#16) and opened another PR (pulsar-edit/text-buffer#17). Don't worry. If this isn't ready for prime time when we're ready to ship 1.133.0, it'll slip to 1.134.0. |
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.
Here’s everything this PR does:
Bumps
@pulsar-edit/text-bufferto 15.0.0.TextBuffer::isDeleted(returnstrueif the buffer is not backed by a file on disk, but used to be).isModified(which previously always returnedtruefor buffers without a file on disk) to be more nuanced around files with “deleted” status:isModifiedwill returnfalseuntil and unless the user makes further buffer changes.isModifiedwill returntrueas it did before.The above bump implicitly changes Pulsar’s behavior when the user tries to close a buffer with “deleted” status. Because
isModifiedreturnsfalsewhen the buffer was not in a modified state at time of file deletion, such files will be able to be closed by the user without an “are you sure?” prompt. This matches VS Code’s behavior.editor.promptWhenAbandoningDeletedFilesetting. Because others have concerns about this change in behavior, this setting will (at least for now) default totrue— which means this new behavior is opt-in.Adds new behavior to the
tabspackage so that it can detect these new states (including the “conflicted” state introduced in Guard against a user saving while the text buffer is conflicted… #1478) and optionally add class names to tabs accordingly so that UI themes can style them.tabs.enableItemStatusColoringsetting, which defaults totrue.Updates the built-in UI themes to style tabs appropriately for each theme when a tab is in the “deleted” state. This mimics how VS Code represents deleted files in the tab — in red, with a strike-through effect.
tabs.enableItemStatusColoringistrue, so a community theme could style conflicted pane items however it wants.Does some other refactors in
pane.js, including some more precise API documentation.Tests were written in
text-bufferand are also written for thetabspackage. I should write at least one more for theeditor.promptWhenAbandoningDeletedFilesetting, so I’ll keep this PR in draft until that happens.