Skip to content

Commit 14acddb

Browse files
committed
Add DebugStringFunExpr methods for Python, R
1 parent 75a3f38 commit 14acddb

4 files changed

Lines changed: 17 additions & 23 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Currently the following languages are supported:
4646
+ Javascript
4747
+ PHP
4848
+ Python
49+
+ R
4950
+ Ruby
5051
+ Shell
5152
+ Vim
@@ -137,3 +138,5 @@ vim.org](https://vim.sourceforge.io/scripts/script.php?script_id=5634)
137138
- [ ] Use travis for CI
138139
- [x] Bug with changing the filename of the current file
139140
- [ ] Make vim-repeat dependency optional
141+
- [ ] Turn supported languages into a table - what do we support in which
142+
language?

ftplugin/common/py_like.vim

Lines changed: 0 additions & 10 deletions
This file was deleted.

ftplugin/python.vim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
let g:path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
2-
3-
function! s:DebugStringFun()
4-
execute 'source ' . g:path . '/common/py_like.vim'
5-
return DebugStringFunPython()
1+
function! s:DebugStringFunBase(desc, var)
2+
let l:debug_str = 'print("' . a:desc . '", ' . a:var . ')'
3+
return l:debug_str
64
endfunc
75

8-
command! -buffer -nargs=0 AddDebugString put=s:DebugStringFun()
9-
6+
command! -buffer -nargs=0 AddDebugString
7+
\ put=s:DebugStringFunBase(g:DebugstringPrefixStr(), g:debugStringCounter)
8+
command! -buffer -nargs=1 AddDebugStringExpr
9+
\ put=s:DebugStringFunBase(<args> . ': ', <args>)

ftplugin/r.vim

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
let g:path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
2-
3-
function! s:DebugStringFun()
4-
execute 'source ' . g:path . '/common/py_like.vim'
5-
return DebugStringFunPython()
1+
function! s:DebugStringFunBase(desc, var)
2+
let l:debug_str = 'message(sprintf("' . a:desc . '%s\n", ' . a:var . '))'
3+
return l:debug_str
64
endfunc
75

8-
command! -buffer -nargs=0 AddDebugString put=s:DebugStringFun()
6+
command! -buffer -nargs=0 AddDebugString
7+
\ put=s:DebugStringFunBase(g:DebugstringPrefixStr(), g:debugStringCounter)
8+
command! -buffer -nargs=1 AddDebugStringExpr
9+
\ put=s:DebugStringFunBase(<args> . ': ', <args>)

0 commit comments

Comments
 (0)