不錯(cuò),簡單,能用。 不過我這里一般這樣聲明函數(shù):
virtual int funcName(xxx xxx,
xxx xxxx,
xxxx* xxxx);
函數(shù)聲明會(huì)有多行,這時(shí)候這個(gè)插件不能正常工作。
再就是生成的函數(shù)定義里面的返回值感覺不是很爽,像剛才那個(gè)函數(shù)里面會(huì)有個(gè)return int(), 而且不帶縮進(jìn),感覺不是很實(shí)用
我留改了一下,主要加了個(gè)處理函數(shù)多行聲明的功能:
2,4c2
< let a:curline = line(".")
< let a:lines = getline(a:curline, search(';'))
< let a:ln = join(a:lines, "\n")
---
> let a:ln = getline(".")
9d6
<
14c11
< let a:fname = substitute(a:ln, '\([a-zA-Z]\+\s\+\)*\(.*\)', '\1'.a:class.'::\2', '')
---
> let a:fname = substitute(a:ln, '\([a-zA-Z]\+\s\+\)*\(.*\)', '\1'.a:class.'::\2', '')
16c13
< endif
---
> endif
22c19
< let a:datas += split(a:ln, "\n")
---
> let a:datas = add(a:datas, a:ln)
23a21,24
> let a:type = substitute(a:ln, '\([a-zA-Z]\+\)\s\+.*', 'return \1();', '')
> if a:type != a:ln
> let a:datas = add(a:datas, a:type)
> endif
27c28
< " execute 'e '.a:cppname
---
> execute 'e '.a:cppname
回復(fù) 更多評(píng)論