-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
clear history when content from disk is changed #703
Conversation
vscode.workspace.onDidChangeTextDocument((event) => { | ||
/* TODO: Remove setTimeout (https://github.com/Microsoft/vscode/issues/11339) */ | ||
setTimeout(() => { | ||
if (event.document.isDirty === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you are typing too fast to check a boolean through ===
:)
@@ -114,6 +115,19 @@ export async function activate(context: vscode.ExtensionContext) { | |||
|
|||
vscode.window.onDidChangeActiveTextEditor(handleActiveEditorChange, this); | |||
|
|||
vscode.workspace.onDidChangeTextDocument((event) => { | |||
/** | |||
* Change from vscode eidtor should set document.isDirty to true but they initially don't! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo eidtor => editor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnfn Fixed
Any reason why Update: It was a github delay |
Generally speaking it shouldn't! You might get yourself into trouble if you've already pushed to a remote though. |
I know :-) |
@johnfn 1 test failed related to clipboard registers which i have already fixed in implement ; and , |
@@ -217,6 +231,13 @@ async function handleKeyEvent(key: string): Promise<void> { | |||
}); | |||
} | |||
|
|||
function handleContentChangedFromDisk(document : vscode.TextDocument) : void { | |||
_.filter(modeHandlerToEditorIdentity, (modeHandler) => modeHandler.fileName === document.fileName) | |||
.forEach((modeHandler) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing about the brackets here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about them? @jpoon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That you can remove the brackets around (modeHandler)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis Ci is not friendly with clipboard tests, specially in mac builds. |
I just restarted the build. |
LGTM, thanks @aminroosta! |
This commit is amazing, now undo is trustworthy! |
@johnfn Fix for #680 !
Let me know if you need something to change :-)