Skip to content

Commit 7ec4f5a

Browse files
committed
Do minor fixes, handle empty string on cexpr completion
1 parent 3ac0c7b commit 7ec4f5a

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ to test.
4646

4747
- The form and syntax of the logging statements target the language at hand
4848
(e.g., use `printf()` in C/C++ but `puts()` in Ruby)
49+
- Support for debugging variable expressions e.g., the values of variables or
50+
arbitrary expressions at certain parts of your code
51+
- Support for <cexpr>: Place your cursor over the variable you want to print and
52+
press `<leader>DS`. It will create a debugging string for that variable
53+
- Support for [vim-repeat](https://github.com/tpope/vim-repeat). No
54+
need for repeat the same mapping, or rewrite the lengthy expression that you
55+
want to monitor, just use the `.` character
56+
4957

5058
Currently the following languages are supported. First column corresponds to the
5159
standard debugging string while the second to the case of debugging for a
@@ -83,13 +91,7 @@ Swift | :x: | :x:
8391
Vim | :heavy_check_mark: | :heavy_check_mark:
8492
Visual Basic | :x: | :x:
8593

86-
- Support for debugging variable expressions e.g., the values of variables or
87-
arbitrary expressions at certain parts of your code
88-
- Support for [vim-repeat](https://github.com/tpope/vim-repeat). No
89-
need for repeat the same mapping, or rewrite the lengthy expression that you
90-
want to monitor, just use the `.` character
91-
92-
For a more detailed outline of `debugstring` check
94+
For a more detailed description of `debugstring` check
9395
[doc/debugstring.txt](https://github.com/bergercookie/vim-debugstring/blob/master/doc/debugstring.txt)
9496

9597
## Usage
@@ -115,7 +117,6 @@ std::cout << "[a.c:4] DEBUGGING STRING ==> " << 0 << std::endl;
115117
std::cout << "[a.c:4] a_variable: " << a_variable << std::endl;
116118
```
117119

118-
119120
### Remarks - Debugging
120121

121122
* Make sure that `filetype plugin` is enabled. A line like `filetype plugin on` in
@@ -139,7 +140,6 @@ std::cout << "[a.c:4] a_variable: " << a_variable << std::endl;
139140
[4]: https://github.com/junegunn/vim-plug
140141
[5]: https://github.com/VundleVim/Vundle.vim
141142

142-
143143
### Dependencies
144144

145145
`debugstring` depends on the following vim plugins:

plugin/debugstring.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,14 @@ function! s:debugFunctionWrapper(mode, ...)
187187
else
188188
let l:expr = ''
189189
if len(a:000) ==# 0
190+
" TODO enable autocompletion
190191
let l:expr = input('Input Expression: ')
191192
else
192193
let l:expr = a:1
193194
endif
194-
if empty(l:expr)
195-
return
196-
endif
195+
endif
196+
if empty(l:expr)
197+
return
197198
endif
198199

199200
AddDebugStringExpr(l:expr)
@@ -237,3 +238,4 @@ nnoremap <silent> <Plug>DumpDebugStringCexpr :<C-U>call <SID>debugFunctionWrappe
237238
let &cpoptions = s:save_cpo
238239
unlet s:save_cpo
239240

241+
" vim shiftwidth=4

0 commit comments

Comments
 (0)