如何突出显示 Xcode 中已更改的行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13184440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to highlight lines in Xcode that have been changed
提问by David Potter
Is there a way to get Xcode to highlight or mark the lines in a file that have been changed? Something like what it does for search results or warnings and errors would be great.
有没有办法让 Xcode 突出显示或标记文件中已更改的行?类似于它对搜索结果或警告和错误所做的事情会很棒。
回答by Joride
回答by Ian Dundas
There's an Xcode plugin which does exactly this: https://github.com/johnno1962/GitDiff
有一个 Xcode 插件可以做到这一点:https: //github.com/johnno1962/GitDiff
You can even customise it:
您甚至可以自定义它:
回答by Tommy
It's not directly in Xcode but to compare to versions of the same file you can use FileMerge. With the modern app bundle type of install you can get to that from Xcode -> Open Developer Tool -> FileMerge. Then just nominate a left file and a right file.
它不是直接在 Xcode 中,而是为了与您可以使用 FileMerge 的同一文件的版本进行比较。使用现代应用程序包类型的安装,您可以从 Xcode -> Open Developer Tool -> FileMerge 进行安装。然后只需指定一个左文件和一个右文件。
If you're talking about versions of a file from one of the supported source control repositories then you can use the version editor — it's one of the options above 'Editor' in the top right of the window or you can find the relevant option in View -> Version Editor -> Show Version Editor. At that point there'll be three options available below the righthand file view (and up in the View -> Version Editor menu), the first of which is a comparison highlighting differences between the current local copy and any of the checked in copies.
如果您正在谈论来自受支持的源代码控制存储库之一的文件版本,那么您可以使用版本编辑器 - 它是窗口右上角“编辑器”上方的选项之一,或者您可以在查看 -> 版本编辑器 -> 显示版本编辑器。此时,右侧文件视图下方将提供三个选项(在视图 -> 版本编辑器菜单中),第一个是突出显示当前本地副本与任何签入副本之间差异的比较。