arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

cTodo 不高亮 #24

Closed lasypig closed 7 years ago

lasypig commented 7 years ago

当 g:chromatica#responsive_mode=1时,注释中的TODO关键字只有当光标移动到该行时才会高亮,如下图: screenshot from 2016-11-02 16 12 26

arakashic commented 7 years ago

我不能重现你说的问题,请附上完整的chromatica配置,以及测试代码。

lasypig commented 7 years ago

昨天那行配置复制错了,我的配置如下:

"===========================
" chromatica
"===========================
let g:diminactive_buftype_blacklist = []
let g:chromatica#libclang_path='/usr/lib/llvm-3.9/lib'
let g:chromatica#enable_at_startup=1
let g:chromatica#highlight_feature_level=1
let g:chromatica#responsive_mode=0

测试代码如下:

/*
 * ===========================================
 *
 *       Filename:  main.c
 *
 *    Description:  TODO: aaa
 *                         TODO: bbb
 *
 *        Version:  1.0
 *        Created:  11/03/2016 09:19:10 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  wangxb (), wangxb@hisome.com
 *   Organization:  
 *
 * =============================================
 */

#include    <stdlib.h>

/* 
 * ===  FUNCTION  ===============================
 *         Name:  main
 *  Description:  
 * =============================================
 */
    int
main ( int argc, char *argv[] )
{
    return EXIT_SUCCESS;
}   /* ----------  end of function main  ---------- */
arakashic commented 7 years ago

let g:chromatica#highlight_feature_level=1的时候cTodo不高亮是正常现象,因为cComment的高亮覆盖了cTodo。我计划解决这个问题,但是这几周事情比较多,没有太多时间来弄这个。

lasypig commented 7 years ago

我暂时注释了函数_get_syntax_group中的这两行:

        elif token.kind.value == 4: # Comment
            return "Comment"

来避免cComment覆盖cTodo,期待你的解决方案。

arakashic commented 7 years ago

I have patched it. I turned off the cComment from chromatica and have the highlight of the comments (including cTodo) fallback to vim. cTodo should just work fine now