diff options
| author | Teddy Wing | 2020-09-29 01:54:17 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2020-09-29 01:54:17 +0200 | 
| commit | e230b24276a018701b6c3b8645c64fc8b1620985 (patch) | |
| tree | e931f72c21ad32926fe71a3971c02997af4085d4 /autoload | |
| parent | 8a05e0113d49585ba1c22251695d5478b1c634ca (diff) | |
| parent | 560239bbd9afb7dbf7ce846160bd687b1cfda03f (diff) | |
| download | vim-grappele-e230b24276a018701b6c3b8645c64fc8b1620985.tar.bz2 | |
Merge branch 'fix-omap'
Diffstat (limited to 'autoload')
| -rw-r--r-- | autoload/grappele.vim | 41 | 
1 files changed, 14 insertions, 27 deletions
| diff --git a/autoload/grappele.vim b/autoload/grappele.vim index 74af532..c0835c9 100644 --- a/autoload/grappele.vim +++ b/autoload/grappele.vim @@ -1,36 +1,23 @@ -function! grappele#Grappele(line, ...) -	let l:current_buffer = 0 -	let l:column_position = 0 -	let l:column_offset = 0 - -	let l:mode = get(a:, 1, '') -	let l:visualmode = get(a:, 2, '') - -	normal! m' - -	if l:mode ==# 'v' -		execute 'normal! ' . l:visualmode -	elseif l:mode ==# 'o' -		normal! V +function! grappele#Grappele(line) +	if a:line !=# 0 +		let s:line = a:line  	endif -	if a:line ==# 0 -		" Go to the end of the buffer -		$ -	else -		let s:line = a:line +	return 'G' +endfunction -		call setpos('.', [ -			\ l:current_buffer, -			\ a:line, -			\ l:column_position, -			\ l:column_offset -		\ ]) +function! grappele#Recall() +	if exists('s:line') +		return s:line . 'G'  	endif + +	return ''  endfunction -function! grappele#Recall(mode) +function! grappele#ORecall()  	if exists('s:line') -		call grappele#Grappele(s:line, a:mode, visualmode()) +		return ':normal! V' . s:line . "G\<cr>"  	endif + +	return "\<C-c>"  endfunction | 
