Angleichen VimSuite und Bmsk

git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@135 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
qx13468 2007-04-16 12:46:25 +00:00
parent 0c7dbfc4be
commit 7c85ee1088
6 changed files with 169 additions and 247 deletions

View File

@ -112,40 +112,3 @@ setlocal errorformat+=%-Oignoring\ option%.%#
" ignore 'file: 123: #error ...' " ignore 'file: 123: #error ...'
setlocal errorformat+=%-O%*\\S\ %*\\d:\ #%.%# setlocal errorformat+=%-O%*\\S\ %*\\d:\ #%.%#
" make options
let g:makeopts = ''
if (g:Motor != '')
let g:makeopts = g:makeopts . ' Motor=' . g:Motor
endif
if (g:Muster != '')
let g:makeopts = g:makeopts . ' Muster=' . Muster
endif
if (g:Egas != '')
let g:makeopts = g:makeopts . ' Egas=' . g:Egas
endif
if (Xlint != '')
let g:makeopts = g:makeopts . ' DIAB_LINT_OPTION=' . Xlint
endif
if (g:SW_Stand != '')
let g:makeopts = g:makeopts . ' Stand=' . g:SW_Stand
endif
" reformat i-file
command! ReformatIFile call Reformat_IFile()
function! Reformat_IFile() abort
let cName = expand('%:t:r') . '.c'
let CR = '\<CR>'
DelAllMultipleEmptyLines
" do not wrap over end of file
setlocal nowrapscan
" go to top of file
execute 'normal gg'
" do unil error
while 1
" delete until line of c-file
execute 'normal d/\c^# \d\+ ".*\(' . cName . '\)' . CR
" go to line of include-file
execute 'normal /\c^# \d\+ ".*\(' . cName . '\)\@<!"' . CR
endwhile
endfunction

View File

@ -23,34 +23,8 @@ command -complete=custom,GetAllBmskProjects -nargs=? SetBmskProject
\ call s:SetBmskProject('<args>') \ call s:SetBmskProject('<args>')
function s:SetBmskProject(basedir) function s:SetBmskProject(basedir)
if ((a:basedir == '') && has('browse')) if (a:basedir == '')
" Browse for makefile let makefile = ''
if exists('g:bmskWA')
let l:bmskWA = g:bmskWA
else
let l:bmskWA = ''
endif
if exists('b:browsefilter')
let l:browsefilter = b:browsefilter
endif
let b:browsefilter =
\ 'Makefiles (make_fsw.bat)\tmake_fsw.bat\n' .
\ 'Makefiles (makefile*)\tmakefile*\n' .
\ 'All Files (*.*)\t*.*'
let makefile = browse(0, 'Select makefile', l:bmskWA, '')
if exists('l:browsefilter')
let b:browsefilter = l:browsefilter
endif
let basedir = fnamemodify(makefile, ':p:h')
let makefile = fnamemodify(makefile, ':t')
if ((makefile == 'make_fsw.bat') || (makefile == 'makefile.mak') || (makefile == 'makefile'))
let g:makeCommand = makefile
let &makeprg = g:makeCommand . ' $*'
call s:SetBmskDirs(basedir)
else
echo 'No makefile:' makefile
endif
else else
" set Workarea and basedir " set Workarea and basedir
if (isdirectory(a:basedir)) if (isdirectory(a:basedir))
@ -58,19 +32,19 @@ function s:SetBmskProject(basedir)
let makefile = fnamemodify(a:basedir . '/make_fsw.bat', ':p') let makefile = fnamemodify(a:basedir . '/make_fsw.bat', ':p')
if !filereadable(makefile) if !filereadable(makefile)
let makefile = glob(a:basedir . '/*/make_fsw.bat') let makefile = glob(a:basedir . '/*/make_fsw.bat')
let basedir = fnamemodify(makefile, ':p:h')
endif endif
if (filereadable(makefile)) if !filereadable(makefile)
let g:makeCommand = makefile echoerr 'No makefile' makefile
let &makeprg = g:makeCommand . ' $*'
call s:SetBmskDirs(basedir)
else
echo 'No makefile' makefile
endif endif
else else
echo 'No directory:' a:basedir echoerr 'No directory:' a:basedir
endif endif
endif endif
call SetProject(makefile)
let GetMakeOptsFunction = function('GetBmskMakeOpts')
let g:GetAllMakeGoals = function('GetAllBmskTargets')
let basedir = getcwd()
call s:SetBmskDirs(basedir)
endfunction endfunction
function GetAllBmskProjects(ArgLead, CmdLine, CursorPos) function GetAllBmskProjects(ArgLead, CmdLine, CursorPos)
@ -432,7 +406,6 @@ function s:SetBmskDirs(bmskdir)
unlet! g:Goals unlet! g:Goals
unlet! g:Programname unlet! g:Programname
unlet! g:OutDirVariante unlet! g:OutDirVariante
unlet! g:bmsk_stand
" Variablen erzeugen, damit GetMakeVar funktioniert " Variablen erzeugen, damit GetMakeVar funktioniert
if !exists('g:Muster') if !exists('g:Muster')
@ -482,8 +455,6 @@ function s:SetBmskDirs(bmskdir)
let g:bmskProject = fnamemodify(g:bmskdir, ':h:h:t') let g:bmskProject = fnamemodify(g:bmskdir, ':h:h:t')
let g:bmsk_sw = fnamemodify(g:bmskdir . '/sw', ':p') let g:bmsk_sw = fnamemodify(g:bmskdir . '/sw', ':p')
let g:bmsk_bios = fnamemodify(g:bmskdir . '/sw/bios', ':p') let g:bmsk_bios = fnamemodify(g:bmskdir . '/sw/bios', ':p')
let g:bmsk_d = GetDfilesDir()
let g:bmsk_stand = GetStandDir()
let g:OutDir = GetOutDir() let g:OutDir = GetOutDir()
let g:OutDirVariante = GetOutDirVariante() let g:OutDirVariante = GetOutDirVariante()
let g:bmsk_ext = '*.c *.h *.kgs *.d *.dat *.mak *.inv' let g:bmsk_ext = '*.c *.h *.kgs *.d *.dat *.mak *.inv'
@ -510,20 +481,11 @@ function s:SetBmskDirs(bmskdir)
let &path = substitute(&path, '\\', '/', 'g') let &path = substitute(&path, '\\', '/', 'g')
" files for tags (may not start with './', since . is the path of the " files for tags (may not start with './', since . is the path of the
" current file " current file
let &tags = substitute(GetCTagsFile(), '^\..', '', '') . ',' . substitute(GetPTagsFile() , '^\..', '', '')
" Grep Dir and Extentions " Grep Dir and Extentions
let g:GrepDir = g:bmsk_sw let g:GrepDir = g:bmsk_sw
let g:GrepFiles = '*.c *.h *.kgs' let g:GrepFiles = '*.c *.h *.kgs'
" cscope
let &cscopeprg = GetCscopePrg()
cscope kill -1
let reffile = GetCscopeFile()
if (filereadable(reffile))
execute 'cscope add' reffile
endif
call s:BmskRedrawMenu() call s:BmskRedrawMenu()
call GetGoals() call GetGoals()
@ -553,7 +515,6 @@ function GetAllMakeVars()
let varnames['OutDir'] = 'OUTDIR' let varnames['OutDir'] = 'OUTDIR'
let varnames['ProductDir'] = 'OUTDIR_PRODUCTS' let varnames['ProductDir'] = 'OUTDIR_PRODUCTS'
let varnames['DfilesDir'] = 'OUTDIR_D_FILES' let varnames['DfilesDir'] = 'OUTDIR_D_FILES'
let varnames['bmsk_stand'] = 'OUTDIR_STAND'
let varnames['OutDirVariante'] = 'OUTDIR_VARIANTE' let varnames['OutDirVariante'] = 'OUTDIR_VARIANTE'
let varnames['CscopePrg'] = 'CSCOPE' let varnames['CscopePrg'] = 'CSCOPE'
let varnames['CscopeFile'] = 'CSCOPEFILE' let varnames['CscopeFile'] = 'CSCOPEFILE'
@ -616,33 +577,6 @@ function GetProductDir()
return g:ProductDir return g:ProductDir
endfunction endfunction
" ---------------------
function GetDfilesDir()
" ---------------------
if !exists('g:DfilesDir')
let g:DfilesDir = GetMakeVar('D_FILES_DIR')
if (g:DfilesDir == '')
let g:DfilesDir = GetMakeVar('OUTDIR_D_FILES')
endif
if (g:DfilesDir != '')
let g:DfilesDir = fnamemodify(g:DfilesDir, ':p')
endif
endif
return g:DfilesDir
endfunction
" --------------------
function GetStandDir()
" --------------------
if !exists('g:bmsk_stand')
let g:bmsk_stand = GetMakeVar('OUTDIR_STAND')
endif
if (g:bmsk_stand != '')
let g:bmsk_stand = fnamemodify(g:bmsk_stand, ':p')
endif
return g:bmsk_stand
endfunction
" -------------------------- " --------------------------
function GetOutDirVariante() function GetOutDirVariante()
" -------------------------- " --------------------------
@ -655,61 +589,13 @@ function GetOutDirVariante()
return g:OutDirVariante return g:OutDirVariante
endfunction endfunction
" ----------------------
function GetCscopePrg()
" ----------------------
if !exists('g:CscopePrg')
let g:CscopePrg = GetMakeVar('CSCOPE')
endif
if (g:CscopePrg != '')
let g:CscopePrg = fnamemodify(g:CscopePrg, ':p')
endif
return g:CscopePrg
endfunction
" ----------------------
function GetCscopeFile()
" ----------------------
if !exists('g:CscopeFile')
let g:CscopeFile = GetMakeVar('CSCOPEFILE')
endif
if (g:CscopeFile != '')
let g:CscopeFile = fnamemodify(g:CscopeFile, ':p')
endif
return g:CscopeFile
endfunction
" ---------------------
function GetCTagsFile()
" ---------------------
if !exists('g:CTagsFile')
let g:CTagsFile = GetMakeVar('CTAGFILE')
endif
if (g:CTagsFile != '')
let g:CTagsFile = fnamemodify(g:CTagsFile, ':p')
endif
return g:CTagsFile
endfunction
" ---------------------
function GetPTagsFile()
" ---------------------
if !exists('g:PTagsFile')
let g:PTagsFile = GetMakeVar('PTAGFILE')
endif
if (g:PTagsFile != '')
let g:PTagsFile = fnamemodify(g:PTagsFile, ':p')
endif
return g:PTagsFile
endfunction
" ----------------- " -----------------
function GetGoals() function GetGoals()
" ----------------- " -----------------
if !exists('g:Goals') if !exists('g:Goals')
let g:Goals = GetMakeVar('GOALS') let g:Goals = GetMakeVar('GOALS')
endif endif
return g:Goals return split(g:Goals)
endfunction endfunction
" ----------------------- " -----------------------
@ -739,14 +625,6 @@ command CleanSRCfile %s/^#\t\(\(r\d\{1,2\}\t\)\|\(not allocated\)\)\t\(\(\$\$\d\
" tags " tags
" ---- " ----
command CscopeConnect call s:CscopeConnect()
function s:CscopeConnect()
let reffile = GetCscopeFile()
if (filereadable(reffile))
execute 'cscope add' reffile
endif
endfunction
" significant characters in tags " significant characters in tags
set taglength=0 set taglength=0
set notagrelative set notagrelative
@ -759,23 +637,48 @@ command -nargs=? GrepBmsk call GrepFull(GetBmskSwDir(), '*.c *.h *.kgs', '<args>
" ---------------- " ----------------
" Make and compile " Make and compile
" ---------------- " ----------------
"command -complete=custom,GetAllBmskTargets -nargs=* Make call s:Make('<args>') command -complete=customlist,GetAllBmskTargets -nargs=* Bmsk Make <args>
command -complete=custom,GetAllBmskTargets -nargs=* Bmsk call s:Make('<args>') command -complete=customlist,GetAllBmskTargets -nargs=* BmskDoku call s:BmskDoku('<args>')
command -complete=custom,GetAllBmskTargets -nargs=* BmskDoku call s:BmskDoku('<args>') command -nargs=* Lint Make <args> %:t:r.lint
command -nargs=* Clean compiler bmsk | Clean <args>
command -nargs=* CleanAll compiler bmsk | CleanAll <args>
command -nargs=* LintOld Bmsk <args> lint file=%:p
command -nargs=* Lint Bmsk <args> %:t:r.lint
command -complete=customlist,GetAllBmskSWStand -nargs=1 BmskAll call s:BmskAll('<args>')
" Programmstand compilieren " make options
function s:Make(args) function GetBmskMakeOpts()
echo a:args let makeopts = ''
cscope kill -1 if (g:Motor != '')
compiler bmsk let makeopts = makeopts . ' Motor=' . g:Motor
execute 'make!' a:args g:makeopts endif
CscopeConnect if (g:Muster != '')
clist let makeopts = makeopts . ' Muster=' . g:Muster
endif
if (g:Egas != '')
let makeopts = makeopts . ' Egas=' . g:Egas
endif
if (g:Xlint != '')
let makeopts = makeopts . ' DIAB_LINT_OPTION=' . g:Xlint
endif
if (g:SW_Stand != '')
let makeopts = makeopts . ' Stand=' . g:SW_Stand
endif
return makeopts
endfunction
" reformat i-file
command ReformatIFile call Reformat_IFile()
function Reformat_IFile() abort
let cName = expand('%:t:r') . '.c'
let CR = '\<CR>'
DelAllMultipleEmptyLines
" do not wrap over end of file
setlocal nowrapscan
" go to top of file
execute 'normal gg'
" do unil error
while 1
" delete until line of c-file
execute 'normal d/\c^# \d\+ ".*\(' . cName . '\)' . CR
" go to line of include-file
execute 'normal /\c^# \d\+ ".*\(' . cName . '\)\@<!"' . CR
endwhile
endfunction endfunction
" Dokumentation erzeugen (Verwenden des LaTeX errorparsers) " Dokumentation erzeugen (Verwenden des LaTeX errorparsers)
@ -825,44 +728,43 @@ function GetAllBmskSWStand(ArgLead, CmdLine, CursorPos)
endfunction endfunction
" Alle Make-Targets als Text Liste " Alle Make-Targets als Text Liste
function GetAllBmskTargets(ArgLead, CmdLine, CursorPos) function GetAllBmskTargets(...)
let goals = GetGoals() let goals = GetGoals()
if goals == '' if goals == []
let targets = 'Programmstand' let goals += ['Programmstand']
let targets = targets . "\n" . 'clean' let goals += ['clean']
let targets = targets . "\n" . 'cleanall' let goals += ['cleanall']
let targets = targets . "\n" . 'cleanProducts' let goals += ['cleanProducts']
let targets = targets . "\n" . 'allTest' let goals += ['allTest']
let targets = targets . "\n" . 'allEntwickler' let goals += ['allEntwickler']
let targets = targets . "\n" . 'allSerie' let goals += ['allSerie']
let targets = targets . "\n" . 'patch_a2l' let goals += ['patch_a2l']
let targets = targets . "\n" . 'check_memory' let goals += ['check_memory']
let targets = targets . "\n" . 'create_csv' let goals += ['create_csv']
let targets = targets . "\n" . 'create_arcus_csv' let goals += ['create_arcus_csv']
let targets = targets . "\n" . 'import_arcus_csv' let goals += ['import_arcus_csv']
let targets = targets . "\n" . 'boschsig' let goals += ['boschsig']
let targets = targets . "\n" . 'archivate' let goals += ['archivate']
let targets = targets . "\n" . 'lint file=' . expand('%:p') let goals += ['lint file=' . expand('%:p')]
let targets = targets . "\n" . 'tags' let goals += ['tags']
let targets = targets . "\n" . 'ctags' let goals += ['ctags']
let targets = targets . "\n" . 'ptags' let goals += ['ptags']
let targets = targets . "\n" . 'cscope' let goals += ['cscope']
let targets = targets . "\n" . 'ccm_products_checkout CCM=' . g:ccm let goals += ['ccm_products_checkout CCM=' . g:ccm]
let targets = targets . "\n" . 'help' let goals += ['help']
else else
let targets = substitute(goals, '\s\+', '\n', 'g') let goals += [expand('%:t:r') . '.obj']
let targets = targets . "\n" . expand('%:t:r') . '.obj' let goals += [expand('%:t:r') . '.i']
let targets = targets . "\n" . expand('%:t:r') . '.i' let goals += [expand('%:t:r') . '.src']
let targets = targets . "\n" . expand('%:t:r') . '.src' let goals += [expand('%:t:r') . '.lint']
let targets = targets . "\n" . expand('%:t:r') . '.lint' let goals += ['FORCE_PROGID=no']
let targets = targets . "\n" . 'FORCE_PROGID=no' let goals += ['MAKE_DBG=2']
let targets = targets . "\n" . 'MAKE_DBG=2' let goals += ['EXTRA_C_FLAGS=']
let targets = targets . "\n" . 'EXTRA_C_FLAGS=' let goals += ['DIAB_OPTIMIZE=']
let targets = targets . "\n" . 'DIAB_OPTIMIZE=' let goals += ['MAIN_MAKEFILES=']
let targets = targets . "\n" . 'MAIN_MAKEFILES=' let goals += ['ALL_EXIT=']
let targets = targets . "\n" . 'ALL_EXIT='
endif endif
return targets return goals
endfunction endfunction
" ----------------------------------- " -----------------------------------

View File

@ -211,6 +211,8 @@ function s:SetProjectVariables()
echomsg 'set the make-variable VIM_COMPILER to the compiler plugin you want to use' echomsg 'set the make-variable VIM_COMPILER to the compiler plugin you want to use'
endif endif
catch /E716/ " Schlüssel nicht vorhanden
echomsg v:exception
catch catch
echoerr 'Error while reading make-variables: ' . v:exception echoerr 'Error while reading make-variables: ' . v:exception
endtry endtry
@ -226,8 +228,15 @@ function GetMakeVars(varNameList)
"echomsg command "echomsg command
let output = system(command) let output = system(command)
let lines = split(output, "\n") let lines = split(output, "\n")
let RE = '^\(\w\+\)=\(.*\)\s*' if len(lines) == 1
let SU = "let varlist['\\1']='\\2'" " make output: value
let RE = '\(.*\)'
let SU = "let varlist['" . vars . "']='\\1'"
else
" make output: var=value
let RE = '^\(\w\+\)=\(.*\)\s*'
let SU = "let varlist['\\1']='\\2'"
endif
"echomsg 'getvars:' "echomsg 'getvars:'
for line in lines for line in lines
"echomsg line "echomsg line
@ -237,11 +246,11 @@ function GetMakeVars(varNameList)
endfor endfor
"echomsg '' "echomsg ''
catch catch
echoerr 'Could not read make variables' echomsg 'Could not read make variables'
endtry endtry
if varlist == {} if varlist == {}
echoerr 'Could not read any variables from makefile' echomsg 'Could not read any variables from makefile'
echo 'Command:' command echo 'Command:' command
echo 'Make output is:' echo 'Make output is:'
for line in lines for line in lines
@ -255,10 +264,10 @@ endfunction
function GetMakeVar(varName) function GetMakeVar(varName)
let var = GetMakeVars([a:varName]) let var = GetMakeVars([a:varName])
try try
varValue = var[a:varName] let varValue = var[a:varName]
catch catch
varValue = '' let varValue = ''
echoerr 'Could not read make-variable "' . varName . '"' echomsg 'Could not read make-variable "' . a:varName . '"'
endtry endtry
return varValue return varValue
endfunction endfunction
@ -266,8 +275,13 @@ endfunction
" ------------------------------------------ " ------------------------------------------
" special make-command for target-completion " special make-command for target-completion
" ------------------------------------------ " ------------------------------------------
" Command
command -complete=customlist,GetAllMakeGoals -nargs=* Make call s:Make('<args>') command -complete=customlist,GetAllMakeGoals -nargs=* Make call s:Make('<args>')
" Targets
function GetAllMakeGoals(...) function GetAllMakeGoals(...)
return g:GetAllMakeGoals()
endfunction
function s:GetDefaultMakeGoals(...)
" evaluate make-goals " evaluate make-goals
if s:Variables['GOALS'] != '' if s:Variables['GOALS'] != ''
try try
@ -281,15 +295,41 @@ function GetAllMakeGoals(...)
echomsg 'set the make-variable VIM_COMPILER to the compiler plugin you want to use' echomsg 'set the make-variable VIM_COMPILER to the compiler plugin you want to use'
endif endif
endfunction endfunction
let g:GetAllMakeGoals = function('s:GetDefaultMakeGoals')
" Options
function GetDefaultMakeOpts()
return ''
endfunction
let g:GetMakeOptsFunction = function("GetDefaultMakeOpts")
function s:Make(args) function s:Make(args)
echo a:args
cscope kill -1 cscope kill -1
execute ':make ' . a:args let makeopts = g:GetMakeOptsFunction()
try execute ':make ' . a:args . makeopts
execute 'cscope add ' . s:Variables['VIM_CSCOPEFILE'] call s:CscopeConnect()
endtry clist
endfunction endfunction
" -----------------
" CSCOPE-Connection
" -----------------
command CscopeConnect call s:CscopeConnect()
function s:CscopeConnect()
try
let cscopefile = s:Variables['VIM_CSCOPEFILE']
if filereadable(cscopefile)
execute 'cscope add ' . cscopefile
elseif cscopefile == ''
echomsg 'cscope: Could not connect: Make-variable "VIM_CSCOPEFILE" is empty'
else
echomsg 'cscope: Could not connect: File ' . cscopefile . ' does not exist'
endif
catch /E716/ " Schlüssel nicht vorhanden
echomsg 'cscope: Could not connect: Make-variable "VIM_CSCOPEFILE" is empty'
endtry
endfunction
" ------------------ " ------------------
" Draw Vimsuite-Menu " Draw Vimsuite-Menu
" ------------------ " ------------------
@ -848,6 +888,25 @@ let g:DirDiffExcludes = '*.log,*.pyc,.svn,_ccmwaid.inf,.static_wa,out,tags,cscop
" options for Vimball " options for Vimball
let g:vimball_home = expand(g:vimsuite . '/vimfiles') let g:vimball_home = expand(g:vimsuite . '/vimfiles')
" GetLatestVimScripts
command GetLatestVimScriptsThroughProxy call s:GetLatestVimScriptsThroughProxy()
function s:GetLatestVimScriptsThroughProxy()
" Get Proxy data
let proxy = input('Proxy: ', 'proxy.muc:8080')
let user = input('User: ', 'qx13468')
let password = inputsecret('Password: ')
let $http_proxy = 'http://' . user . ':' . password . '@' . proxy
" Set HOME for autoinstall
let home = $HOME
let $HOME=g:vimsuite
" Get the scripts
GetLatestVimScripts
" reset HOME
let $HOME = home
endfunction
let g:GetLatestVimScripts_wget= "c:/tools/wget/wget.exe"
let g:GetLatestVimScripts_mv= "move"
" merge " merge
command -nargs=+ Merge call Merge(<args>) command -nargs=+ Merge call Merge(<args>)
function Merge(...) function Merge(...)

View File

@ -205,16 +205,6 @@ set spelllang=de
set spellfile=$VIM/myspell.add set spellfile=$VIM/myspell.add
let &spellfile=&spellfile . ',' . g:vimfiles . '/spell/bmsk.add' let &spellfile=&spellfile . ',' . g:vimfiles . '/spell/bmsk.add'
" -------------
" other Plugins
" -------------
" GetLatestVimScripts
let $http_proxy='http://qx13468:tinaist1@proxy.muc:8080'
let g:GetLatestVimScripts_wget= "c:/tools/wget/wget.exe"
let g:GetLatestVimScripts_mv= "move"
"let $HOME=g:vimsuite
if exists('g:debug') if exists('g:debug')
if (g:debug > 0) if (g:debug > 0)
echo 'loaded vimrc' echo 'loaded vimrc'

View File

@ -16,5 +16,5 @@ ScriptID SourceID Filename
948 2878 Scons Compiler plugin 948 2878 Scons Compiler plugin
1709 6421 Scons Syntax file 1709 6421 Scons Syntax file
1772 6973 DAMOS.zip DAMOS tools (von Stefan) 1772 6973 DAMOS.zip DAMOS tools (von Stefan)
987 6809 DoxygenToolkit.vim 987 6978 DoxygenToolkit.vim
1397 6887 xml.vim 1397 6887 xml.vim

View File

@ -1,9 +1,12 @@
" DoxygenToolkit.vim " DoxygenToolkit.vim
" Brief: Usefull tools for Doxygen (comment, author, license). " Brief: Usefull tools for Doxygen (comment, author, license).
" Version: 0.1.16 " Version: 0.1.17
" Date: 02/27/07 " Date: 04/15²07
" Author: Mathias Lorente " Author: Mathias Lorente
" "
" Note: Number of lines scanned is now configurable. Default value is still 10
" lines. (Thanks to Spencer Collyer for this improvement).
"
" Note: Bug correction : function that returns null pointer are correctly " Note: Bug correction : function that returns null pointer are correctly
" documented (Thanks to Ronald WAHL for his report and patch). " documented (Thanks to Ronald WAHL for his report and patch).
" "
@ -257,6 +260,11 @@ else
let g:DoxygenToolkit_ignoreForReturn = g:DoxygenToolkit_ignoreForReturn . " inline static virtual void" let g:DoxygenToolkit_ignoreForReturn = g:DoxygenToolkit_ignoreForReturn . " inline static virtual void"
endif endif
" Maximum number of lines to check for function parameters
if !exists("g:DoxygenToolkit_maxFunctionProtoLines")
let g:DoxygenToolkit_maxFunctionProtoLines = 10
endif
" Add name of function after pre brief tag if you want " Add name of function after pre brief tag if you want
if !exists("g:DoxygenToolkit_briefTag_funcName") if !exists("g:DoxygenToolkit_briefTag_funcName")
let g:DoxygenToolkit_briefTag_funcName = "no" let g:DoxygenToolkit_briefTag_funcName = "no"
@ -311,14 +319,14 @@ function! <SID>DoxygenCommentFunc()
endif endif
" Get the entire function " Get the entire function
let l:count = 0 let l:count = 0
while ( l:lineBuffer !~ l:argEnd && l:count < 10 ) while ( l:lineBuffer !~ l:argEnd && l:count < g:DoxygenToolkit_maxFunctionProtoLines )
exec "normal j" exec "normal j"
let l:line = getline(line(".")) let l:line = getline(line("."))
let l:lineBuffer = l:lineBuffer . ' ' . l:line let l:lineBuffer = l:lineBuffer . ' ' . l:line
let l:count = l:count + 1 let l:count = l:count + 1
endwhile endwhile
" Function definition seem to be too long... " Function definition seem to be too long...
if ( l:count == 10 ) if ( l:count == g:DoxygenToolkit_maxFunctionProtoLines )
" Restore standard comment expension " Restore standard comment expension
let &comments = l:oldComments let &comments = l:oldComments
" Restore indentation " Restore indentation