You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode自动保存时代码上移、撤销次数异常问题求助

开启VSCode自动保存后代码自动上移且撤销异常问题

开启VSCode的autoSave模式(设置为afterDelay)后,无论在代码的任意位置编辑内容,自动保存时代码都会上移数行——最初仅上移1行,数天后变为上移5至10行;按Ctrl+Z撤销编辑内容时,需连续点击3至4次才能完成撤销。

操作前后截图

  • 编辑前:编辑前代码状态
  • 自动保存后:自动保存后代码状态

当前settings.json配置

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "prettier.singleQuote": true,
  "prettier.requireConfig": true,
  "eslint.format.enable": true,
  "git.suggestSmartCommit": false,
  "git.autofetch": true,
  "git.confirmSync": false,
  "editor.tabSize": 2,
  "yaml.schemas": {
    "file:///home/sm/.vscode/extensions/atlassian.atlascode-3.0.1/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
  },
  "redhat.telemetry.enabled": false,
  "[php]": {
    "editor.formatOnType": true
  },
  "liveServer.settings.donotShowInfoMsg": true,
  "editor.lineHeight": 2,
  "explorer.confirmDelete": false,
  "editor.formatOnSave": true,
  "files.insertFinalNewline": false,
  "emmet.includeLanguages": {
    "twig": "html"
  },
  "window.zoomLevel": -1,
  "eslint.codeActionsOnSave.rules": null,
  "eslint.options": {},
  "files.associations": {
    "*.twig": "twig"
  },
  "[twig]": {
    "editor.defaultFormatter": "mblode.twig-language-2"
  },
  "php.format.rules.spaceBeforeColonInReturnType": true,
  "workbench.colorTheme": "One Dark Pro Darker",
  "files.autoSave": "afterDelay"
}

已安装扩展列表

已安装VSCode扩展列表

系统环境与已尝试操作

  • 系统:Ubuntu 20.04
  • 已尝试:禁用所有扩展、开关autoSave模式、重载VSCode窗口、重启系统,问题仍未解决。

内容的提问来源于stack exchange,提问作者Stefan Mihaylovski

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.28 15:53:24