【问题标题】:textmate suddenly showing <CR> tag in code filestextmate 突然在代码文件中显示 <CR> 标签
【发布时间】:2014-09-12 07:10:39
【问题描述】:

我已经使用 Textmate version 2 fro MAC 已经有一段时间了,但昨天突然在我的代码文件中看到一个 &lt;CR&gt; tag,不知道是什么问题,在做了一些谷歌搜索后,我发现它应该是一个隐形字符,

但是现在我该如何删除它,任何人都可以提出任何想法谢谢。

【问题讨论】:

    标签: textmate textmate2


    【解决方案1】:

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

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

    如果文件的行尾不一致,Textmate 会将\n 视为行尾标记并将&lt;CR&gt; 显示为文本。


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

    【讨论】:

    • 我用我的用户名替换user 吗?
    • 谢谢,但在TextMate version 2.0-beta.7.1上不起作用
    【解决方案2】:

    用textmate打开文件,选择一个,复制。打开“查找”对话框并激活“正则表达式”选项。粘贴 , 并将它们全部替换为空字符串。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-05
      • 2022-07-04
      • 2013-12-16
      • 1970-01-01
      • 1970-01-01
      • 2015-12-09
      • 2016-12-13
      • 1970-01-01
      相关资源
      最近更新 更多