TextMate 突然在代码文件中显示 <CR> 标记

标签 textmate textmate2

我已经使用适用于 MAC 的 TextMate 版本 2 已经有一段时间了,但昨天突然在我的代码文件中看到 <CR>标签。

不确定问题是什么。经过一番谷歌搜索后,我发现它应该是一个隐形角色。

但是现在我该如何删除它,有人可以提出任何想法吗?

谢谢。

最佳答案

Textmate 文件使用三个选项之一进行设置..

  • CR (例如回车符或 \r )行结尾。
  • LF (例如换行或 \n )
  • CRLF (例如回车换行或 \r\n )

如果文件的行结尾不一致,Textmate 将处理 \n作为行结束标记并显示 <CR>作为文本。

<小时/>

该问题是由启动服务数据库损坏引起的,可以通过在终端中运行以下命令并重置 Finder 来修复。

sudo /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder
<小时/>
lsregister: [OPTIONS] [-domain { system | local | user | network }]... [path]...
Search the paths for application bundles and add each found item to the Launch
Services database.  For domain specifications, ask CF for the list of application
locations in the given domain(s).

  -kill     Reset the global Launch Services database before doing anything else
  -lint     Print information about plist errors while registering bundles
  -convert  Register apps found in older LS database files
  -load     Load the LaunchServices service plugin if it's not already loaded.
  -lazy n   Sleep for n seconds before registering apps if the local cache
            is aleady populated.
  -r        Recursively register directory contents, do not recurse into
            packages or invisible directories.
  -R        Recursively register directory contents, including the contents
            of packages and invisible directories.
  -f        force-update registration info even if mod date is unchanged
  -v        Display progress information.
  -dump     Display full database contents after registration.
  -h        Display this help.

关于TextMate 突然在代码文件中显示 <CR> 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25802713/

相关文章:

ruby - Textmate + Ruby : ruby: warning: -K is specified; it is for 1. 8 兼容性,可能导致奇怪的行为

TextMate TODO 无法正常工作

sublimetext2 - 如何在 Sublime Text 2 或 TextMate 2 中同时使用 Latex 和 Markdown 语法高亮?

julia - 从 Textmate 运行 Julia

git - 如何从 Textmate 2 的项目抽屉中删除 SCM 文件状态

textmate2 - 为 rbenv 配置 Textmate 2

textmate - TextMate 2 的 indentOnPaste 有哪些选项,或者我如何完全禁用它?

textmate - 获取不带扩展名的文件名,textmade 捆绑编辑器

vim - 将 Emacs/vim 高亮转换为 TextMate(用于 SublimeText)

Textmate - 缩进不再适用于快捷方式 Cmd + ]