Skip to content

Commit ddc62f0

Browse files
committed
Replace getcurpos with getpos, line()
1 parent 506b76e commit ddc62f0

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
tags
22
a.*
33
vader.vim
4+
vim-repeat

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ language: vim
22

33
before_script: |
44
git clone https://github.com/junegunn/vader.vim.git
5+
git clone https://github.com/tpope/vim-repeat.git
56
6-
script: |
7+
script:
78
# Will return 1 in case of errors - 0 otherwise
89
vim -Nu test/vimrc -c 'Vader! test/*'

plugin/debugstring.vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"
1717
" The form and syntax of the logging statements target the language at hand
1818
" (e.g., use printf() in C/C++ but puts() in Ruby)
19+
"
20+
" vim-debugstring should be compatible with Vim >= 7.4.313
21+
"
1922

2023
""
2124
" @section Configuration, config
@@ -88,9 +91,9 @@ let g:debugStringCounterStep = 1
8891
function! g:DebugstringPrefixStr()
8992
let l:debug_str = '[' . fnamemodify(bufname('%'), ':t') . ':'
9093
if getline('.') =~# '^$' " Empty line
91-
let l:debug_str .= getcurpos()[1]
94+
let l:debug_str .= line('.')
9295
else
93-
let l:debug_str .= string(str2nr(getcurpos()[1]) + 1)
96+
let l:debug_str .= string(str2nr(line('.')) + 1)
9497
endif
9598
let l:debug_str .= '] DEBUGGING STRING ==> '
9699

@@ -149,7 +152,7 @@ let g:debugstringAlwaysIncludeHeader = 0 " Include Header in place?
149152
"
150153
"
151154
function! s:debugFunctionWrapper(mode, ...)
152-
let l:prev_pos = getcurpos()
155+
let l:prev_pos = getpos('.')
153156

154157
let l:append_at_same_line = 0
155158
if getline('.') =~# '^$' " Empty line
@@ -193,7 +196,7 @@ function! s:debugFunctionWrapper(mode, ...)
193196
endif
194197

195198
" correct indentation level
196-
if indent(getcurpos()[1] - 1) !=# 0
199+
if indent(line('.') - 1) !=# 0
197200
normal! k0vwhyjP
198201
endif
199202
normal! ==

test/vimrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ let g:mapleader = ","
33

44
set runtimepath+=.
55
set runtimepath+=vader.vim
6+
set runtimepath+=vim-repeat
67
set runtimepath+=after
7-
set runtimepath+=~/.vim/bundle/vim-repeat
88

99
filetype plugin indent on
1010
syntax enable

0 commit comments

Comments
 (0)