textmate突然在代码文件中显示<cr>标签</cr>

时间:2014-09-12 07:10:40

标签: textmate textmate2

我从很长一段时间以来一直在使用 Textmate version 2 fro MAC 但是昨天在我的代码文件中我突然看到 <CR> tag ,不确定问题是,在做了一些谷歌搜索后发现它应该是一个不可见的角色,

但现在我如何删除它,任何人都可以建议任何想法谢谢。

2 个答案:

答案 0 :(得分:2)

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

  • CR(例如,回车或\r)行结尾。
  • LF(例如换行或\n
  • CRLF(例如,回车路线Feed或\r\n

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


此问题是由损坏的Launch Services数据库引起的,可以通过在终端中运行以下命令并重置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.

答案 1 :(得分:0)

用textmate打开文件,选择一个,复制它。打开&#34;找到&#34;与&#34;正则表达式对话#34;选项已激活。粘贴,然后用空字符串替换它们。