2020" "
2121" @section Configuration, config
2222" To add a logging statement either use the default normal mode mapping
23- " (@setting(default_dump_debug_map)) or define your own
23+ " (@setting(default_dump_debug_map)) or define your own:
2424"
25- " nmap <your-key-combination> <Plug>DumpDebugString
26- " nmap <a-second-key-combination> <Plug>DumpDebugStringExpr
25+ " * nmap <your-key-combination> <Plug>DumpDebugString
26+ "
27+ " * nmap <a-second-key-combination> <Plug>DumpDebugStringExpr
2728
2829" "
2930" @section Functions
@@ -81,6 +82,7 @@ let s:modes = {
8182let g: debugStringCounter = 0
8283let g: debugStringCounterStep = 1
8384
85+ " "
8486" By default debugging lines should be of the form
8587" <directive_to_print> <prefix_string><debug_number>
8688function ! g: DebugstringPrefixStr ()
@@ -103,6 +105,8 @@ function! s:resetDebugCounter()
103105 let g: debugStringCounter = 0
104106endfunc
105107
108+ " }}}
109+
106110" "
107111" Reset the debugging counter
108112"
@@ -119,11 +123,12 @@ endfunc
119123if ! hasmapto (' <Plug>DumpDebugString' )
120124 " "@setting default_dump_debug_map
121125 "
122- nmap <unique> <Leader> ds <Plug> DumpDebugString
126+ nmap <nowait> < unique> <Leader> ds <Plug> DumpDebugString<CR>
123127 " "@setting default_dump_debug_map
124128 "
125- nmap <unique> <Leader> dS <Plug> DumpDebugStringExpr
129+ nmap <nowait> < unique> <Leader> dS <Plug> DumpDebugStringExpr
126130endif
131+
127132" "
128133" Set this to false if you want to print just the logging statement without any
129134" additional directive like '#include <stsdio.h'
@@ -132,6 +137,7 @@ endif
132137"
133138let g: debugstringAlwaysIncludeHeader = 0 " Include Header in place?
134139
140+ " "
135141" Wrapper around the low-level debug* methods.
136142" It also takes care of incrementing the g:debugCounter
137143"
@@ -204,6 +210,10 @@ function! s:debugFunctionWrapper(mode, ...)
204210 call setpos (' .' , l: new_pos )
205211endfunc
206212
213+ " "
214+ " For debugging, execute a <Plug> command using execute:
215+ " :execute "normal \<Plug>DumpDebugString"
216+ "
207217nnoremap <silent> <Plug> DumpDebugString :<C-U> :call <SID> debugFunctionWrapper(0)<CR>
208218nnoremap <silent> <Plug> DumpDebugStringExpr :<C-U> :call <SID> debugFunctionWrapper(1)<CR>
209219
0 commit comments