Vim: Undo does not work after save

Created on 30 May 2017  路  23Comments  路  Source: VSCodeVim/Vim

  • Click thumbs-up 馃憤 on this issue if you want it!
  • Click confused 馃槙 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Environment:

  • VSCode Version: Insiders
  • VsCodeVim Version: 0.8.4
  • OS: macOS 10.12.6

What happened:
After saving a file with :w I cannot undo anymore.

What did you expect to happen:
Continue undoing the horrors I inflicted on the file.

How to reproduce it:
Make some changes to a file, save it and try to undo those changes.

kinbug

All 23 comments

This issue doesn't seem to occur for me, with VSCodeVim version 0.8.4 and ArchOS.

Ah I see. Does this only happen when your save renames the file? Like, you open up a completely new file, save it with a name, and then try to undo?

Happens to me also

  • VSCodeVim version 0.8.4
  • VSCode Version 1.13.0-insider (1.13.0-insider)
  • Mac OS Sierra 10.12.5

VSCodeVim undo is totally unusable for me right now (default ctrl+z works just fine). Whenever a file is saved there is no undo history. It's not just when filename is changed, any save at all seems to erase undo history. I am using auto save after 1 second delay, so I have 1 second of undo history 馃槃. Turning auto save off is more usable at the moment, but doesn't fix the problem.
EDIT: Same behavior on my laptop and desktop

  • VSCodeVim version 0.8.4
  • VSCode Version 1.13.0-insider
  • Windows 10

@erlais @darkermatter Could you guys post your settings?

// Place your settings in this file to overwrite the default settings
{
    "workbench.colorTheme": "Monokai-Soft",
    "workbench.iconTheme": "vscode-simpler-icons",
    "workbench.welcome.enabled": false,
    "workbench.activityBar.visible": false,
    "workbench.colorCustomizations": {
        "statusBar.background": "#B16900",
        "statusBar.noFolderBackground": "#B16900",
        "statusBar.debuggingBackground": "#B16900"
    },
    "vim.hlsearch": true,
    "vim.statusBarColorControl": true,
    "vim.statusBarColors": {
        "normal": "#000000",
        "insert": "#B00B0B",
        "replace": "#B00B0B",
        "visual": "#B16900",
        "visualline": "#B16900",
        "visualblock": "#B16900"
    },
    "editor.fontFamily": "Monaco",
    "editor.fontSize": 12.3,
    "editor.tabSize": 2,
    "editor.lineNumbers": "relative",
    "zenMode.hideStatusBar": false,
    "problems.autoReveal": true,
    "window.titleBarStyle": "custom",
    "clock.dateFormat": "    HH:MM    ",
    "gitProjectManager.baseProjectsFolders": [
        "/Projects"
    ],
    "go.testOnSave": false,
    "go.coverageOptions": "showUncoveredCodeOnly",
    "go.lintTool": "gometalinter",
    "go.lintFlags": [
        "--vendor",
        "--disable-all",
        "--enable=errcheck",
        "--enable=vet",
        "--enable=vetshadow",
        "--enable=golint",
        "--enable=ineffassign",
        "--enable=goconst",
        "--tests"
    ],
    "go.autocompleteUnimportedPackages": true,
    "git.enableSmartCommit": true,
    "todohighlight.isEnable": true,
    "todohighlight.include": "{**/*.js,**/*.jsx,**/*.ts,**/*.html,**/*.php,**/*.css,**/*.scss,**/*.go}",
    "todohighlight.exclude": "{**/node_modules/**,**/bower_components/**,**/dist/**,**/build/**,**/.vscode/**,**/_output/**,**/*.min.*,**/*.map,**/vendor/**}",
    "editor.cursorBlinking": "solid",
    "editor.cursorStyle": "block",
    "editor.minimap.enabled": false,
    "workbench.statusBar.visible": true,
    "material-icon-theme.showUpdateMessage": false,
    "vim.foldfix": true,
    "vim.enableNeovim": true,
    "vim.neovimPath": "/usr/local/bin/nvim",
    "vim.disableAnnoyingNeovimMessage": true,
    "vsicons.dontShowNewVersionMessage": true
}

My settings in Pastebin

Edit: I removed all my settings, keybindings, extensions. Uninstalled neovim. Did a new insiders update, Put only VSCodeVim back, opened a new window so I wouldn't be inside a project. Still the same issue. Uninstalled VSCode completely and reinstalled - still same.

Edit2: I should mention that I have had unexpected extension keybind behavior before and it was caused by some of my system/region/language settings being non-standard (Estonian). That particular issue was related to creating/editing timestamps. Not sure if undo in this case has anything to do with time or other region settings, but looks like @darkermatter might be Spanish and is having similar issue.

Oh and just to be clear, it did work before. Pretty sure after the nvim update it broke.

I was just able to replicate this issue. May have something to do with the amount of load your computer is currently under?

@erlais I have an international English keyboard with the Irish keyboard layout (generally faster for typing Spanish than a Spanish keyboard隆!隆!) and Spanish regional settings. I have never had any issues with this setup.

Also, the nvim update sounds about right.

@Chillee This happens under all load conditions.

+1 Confirmed. :neutral_face: Can't redo my operations after saving.

  • VSCodeVim version 0.8.4
  • VSCode Version 1.13.0
  • Windows 10 x64 1607

settings.json

Same here. But... it does work when you use cmd+z

@dkln And cmdshiftz :no_mouth:

Also experiencing this. No undo available directly after save.

VSCodeVim version 0.8.4
VSCode Version 1.13.0
macOS 10.12.5


settings

{
    "vim.enableNeovim": true,
    "vim.disableAnnoyingNeovimMessage": true,
    "vim.easymotion": true,
    "vim.leader": " ",
    "editor.wordWrap": "bounded",
    "editor.tabSize": 2,
    "editor.tabCompletion": true,
    "vim.hlsearch": true,
    "vim.incsearch": true,
    "vim.statusBarColorControl": true,
    "vim.useSystemClipboard": true,
    "vim.statusBarColors": {
        "normal": "#005f5f",
        "insert": "#5f0000",
        "visual": "#5f00af",
        "visualline": "#005f87",
        "visualblock": "#86592d",
        "replace": "#000000"
    },
    "workbench.colorCustomizations": {
        "statusBar.background": "#005f87",
        "statusBar.noFolderBackground": "#005f87",
        "statusBar.debuggingBackground": "#005f87"
    },
    "workbench.colorTheme": "Dark (Monokai)",
    "editor.wordWrapColumn": 100,
    "vim.textwidth": 100,
    "editor.multiCursorModifier": "ctrlCmd",
    "window.zoomLevel": -1,
    "extensions.ignoreRecommendations": false,
    "editor.renderWhitespace": "boundary",
    "files.trimTrailingWhitespace": true
}

Oh shit I just realized. Fuck.

This is a change to VSCode version 1.13.0. The reason @darkermatter, @am1ko, and @erlais reported this issue early is because they're on insiders.

Now that version 1.13.0 has dropped, everybody's getting this issue (including me). It has to do with a change to VSCode on how they're handling dirty files.

Fixable?

@bjeanes Definitely. I wrote about what I figured out here: https://github.com/VSCodeVim/Vim/issues/1814

It might be worth it for me to switch to Insiders so I can see these things before they happen...

Seeing issue here also.... Save file, history is gone... Please fix, I really don't want to go back to Atom...

We just pushed out a new release, and this problem should be fixed in v0.8.5

I've switched to 1.13 stable and it works there.

@darkermatter it should work anywhere if you v0. 8.5 of vscodevim installed.

馃憤 鉂わ笍

I'm on Version 1.19.1 with Vim 0.10.6 and just hit this. Possibly because I'm also using the go plugin?

Same here. I have autosave on and hitting u does nothing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredly picture jaredly  路  3Comments

orn688 picture orn688  路  3Comments

liamdawson picture liamdawson  路  3Comments

elithrar picture elithrar  路  3Comments

st-schneider picture st-schneider  路  3Comments