question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undo via `u` does not remove file dirty flag

See original GitHub issue

Describe the bug Using u to undo changes doesn’t restore the file to a clean state when reverting back to the original file that was opened.

To Reproduce Steps to reproduce the behaviour:

  1. open file
  2. enter insert mode
  3. insert a space, observe tab has dirty icon
  4. exit to normal mode and press u to remove change
  5. File is still considered dirty

Expected behaviour If you perform this same operation but instead of pressing u you press ctrl+z the file will return to a clean state, this should be the same for u

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.16.12
  • VSCode version: 1.28.2
  • OS: Ubuntu 18 LTS

Additional context Related issue in vscode for context https://github.com/Microsoft/vscode/issues/919

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:50
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

22reactions
abbondanzacommented, Jan 31, 2019

Here’s a quick solution to this problem (until there’s an official one):

    "vim.normalModeKeyBindings": [
        {
            "before" : ["u"],
            "commands" : [
                "undo"
            ]
        },
        {
            "before" : ["<C-r>"],
            "commands" : [
                "redo"
            ]
        }
    ]
4reactions
MrHatecommented, May 2, 2020

Here’s a quick solution to this problem (until there’s an official one):

    "vim.normalModeKeyBindings": [
        {
            "before" : ["u"],
            "commands" : [
                "undo"
            ]
        },
        {
            "before" : ["<C-r>"],
            "commands" : [
                "redo"
            ]
        }
    ]

A confusing point is, after I use O to produce an indented new line, I need to press u twice to undo this operation. One for the indent, the other one for the new line.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove dirty flag when editing value in extjs editable ...
IF YOU DON'T NEED TO COMMIT, you can use this workaround. the record.set method is not calculated by grid cellediting marker.
Read more >
21493 – Java editor dirty flag '*' should go away if all ... - Bugs
If I make any change to a newly opened Java file, an asterisk appears before the filename in the tab for the editor...
Read more >
How to git clean untracked files example - TheServerSide.com
Run 'git clean -f' to force untracked file deletion;; Use 'git clean -f -d' to remove untracked directories;; Use 'git clean -f -x'...
Read more >
Remove Dirty Flag When Cell Value Is Changed to Original
An example on how to remove the dirty indicator when the value is put back to the original state in the Kendo UI...
Read more >
Scripting API: EditorUtility.ClearDirty - Unity - Manual
Clear the dirty flag if you make changes to an asset that don't need to be saved, such as temporary changes that you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found