如何在VS Code中比较两个未保存的文件?

huangapple go评论48阅读模式
英文:

How can I compare two unsaved files in VS Code?

问题

我在VS Code中有两个未保存的文件,想要进行比较。我的在线搜索引导我到了这个GitHub问题,日期是2016年:https://github.com/microsoft/vscode/issues/14501

看起来这个功能应该是可用的。甚至有另一个VS Code开发团队成员验证了它。但是,我不知道该如何操作?

由于这些文件没有保存,我不能转到资源管理器并右键单击选择“选择以进行比较”和“与所选进行比较”。我尝试调用<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>菜单,看看在未保存的文件编辑器处是否可以找到这两个选项。但是并没有出现这样的选项。

这个功能真的存在于VS Code中吗?
VS Code开发团队成员如何在没有我搜索的UI元素的情况下验证它?
还是我搜索的地方不对,选择比较和与所选进行比较的UI确实存在于VS Code中?

英文:

I have two unsaved files in VS Code and am looking to compare them. My online searches led me to this GitHub issue from 2016: https://github.com/microsoft/vscode/issues/14501

It seems as though this feature should be available. Another VS Code development team member even validated it. However, I am struggling to come up with how would I do it?

Since the files are not saved I can't go to the Explorer and right-click to select Select For Compare and Compare With Selected. I tried calling up the <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> menu and seeing if those two options can be found there when an unsaved file editor is active. But no such options came up.

Is this feature really in VS Code?
How could the VS Code dev team member validate it without the UI elements I searched for?
Or did I search in a wrong place and the UI for selecting for compare and comparing with selected does exist in VS Code?

答案1

得分: 2

你至少有两个选项:

  • 你可以专注于其中一个未命名文件,然后在命令面板中使用 文件:比较活动文件与... 命令,这将打开一个菜单以选择要进行比较的文件-此时你可以选择另一个你想要比较的未命名文件。

  • 另一个选项是使用资源管理器视图中的“打开的编辑器”部分,你可以右键单击一个未命名文件,选择“选择比较”,然后右键单击你想要进行比较的文件,然后选择“与所选项比较”。

英文:

You have at least two options:

  • You can focus on of those untitled files and then use the File: Compare Active File With... command in the command palette, which will open a menu to select what to compare it with- at which point you can select the other untitled file you want to compare it with.

  • The other option is to use the Explorer View's "Open Editors" section, where you can right-click one untititled file, click the "Select for Compare" item, and then right click the one you want to compare with, and then click "Compare with Selected".

答案2

得分: -1

如果您在vs Code的右侧面板上单击第一个选项卡**explorer,您可以在附加的截图中看到,这里有一个timelines**窗口,其中包含了页面的整个历史记录,还会存储已保存更改和提交更改的历史记录。

如何在VS Code中比较两个未保存的文件?

我认为这可能会有所帮助:
如何在VS Code中比较两个未保存的文件?

英文:

If you click on the right panel of vs Code the first tab is explorer, which you may see in the screenshot attached, here there is a timelines window that holds the whole history of the page, and also stores the history of saved changes and commit changes too.

如何在VS Code中比较两个未保存的文件?

I think this may help:
如何在VS Code中比较两个未保存的文件?

huangapple
  • 本文由 发表于 2023年6月26日 18:33:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/76555862.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定