Shougo/neoinclude.vim

ctags regex langmap flag problem

Closed this issue · 2 comments

Consider the following R file foo.R:

x <- 1
foo <- function () {
    y <- 2
    return(y)
}
print(x)
print(foo())

Now in your .ctags file add:

--langdef=R
--langmap=R:.R.r
--regex-R=/^[ \t]*"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t]function[ \t]*\(/\1/f,Functions/
--regex-R=/^"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t][^\(]+$/\1/g,Global_Variables/
--regex-R=/[ \t]"?([.A-Za-z][.A-Za-z0-9_]*)"?[ \t]*<-[ \t][^\(]+$/\1/v,Function_Variables/

Finally use the following minimal vimrc:

set nocompatible

let $ONEDRIVE_HOME = expand('C:/OD/Users/Pedro')
let $DOTVIM = expand('$ONEDRIVE_HOME/vimfiles')

set runtimepath+=$DOTVIM/bundle/unite
set runtimepath+=$DOTVIM/bundle/neoinclude
set runtimepath+=$DOTVIM/bundle/unite-tag
set runtimepath+=$DOTVIM/bundle/vimproc
filetype plugin indent on

nnoremap <silent> ,te :NeoIncludeMakeCache<CR>:sleep 3m<CR>:Unite
            \ tag/include<CR>

Open Gvim and edit the foo.R file. Press ,te and you will see that no candidates will be shown. However if you write the .ctags file like this --langmap=R:.r.R candidates are shown.
So for some reason neoinclude is not correctly parsing the --langmap flag. It seem to only take into account the last file extension in --langmap.

neoinclude does not parse .ctags file.
So, it is ctags problem or your patterns problem.
Closing.

Okay I will check if it is a ctags problem. Thanks