mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-10 20:13:46 -05:00
Fixed motions
This commit is contained in:
@@ -610,8 +610,6 @@ function! s:Align(lines) "{{{3
|
|||||||
return lines
|
return lines
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Public API {{{1
|
" Public API {{{1
|
||||||
|
|
||||||
function! tablemode#sid() "{{{2
|
function! tablemode#sid() "{{{2
|
||||||
@@ -789,7 +787,7 @@ function! tablemode#TableMotion(direction) "{{{2
|
|||||||
if tablemode#IsATableRow('.')
|
if tablemode#IsATableRow('.')
|
||||||
if a:direction ==# 'l'
|
if a:direction ==# 'l'
|
||||||
if s:IsLastCell()
|
if s:IsLastCell()
|
||||||
if !tablemode#IsATableHeader(line('.') + s:RowGap()) && !tablemode#IsATableRow(line('.') + s:RowGap())
|
if !tablemode#IsATableRow(line('.') + s:RowGap()) || (tablemode#IsATableHeader(line('.') + s:RowGap()) && tablemode#IsATableRow(line('.') + 2 * s:RowGap()))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call tablemode#TableMotion('j')
|
call tablemode#TableMotion('j')
|
||||||
@@ -804,7 +802,7 @@ function! tablemode#TableMotion(direction) "{{{2
|
|||||||
endif
|
endif
|
||||||
elseif a:direction ==# 'h'
|
elseif a:direction ==# 'h'
|
||||||
if s:IsFirstCell()
|
if s:IsFirstCell()
|
||||||
if !tablemode#IsATableHeader(line('.') - s:RowGap()) && !tablemode#IsATableRow(line('.') - s:RowGap())
|
if !tablemode#IsATableRow(line('.') - s:RowGap()) || (tablemode#IsATableHeader(line('.') - s:RowGap()) && tablemode#IsATableRow(line('.') - 2 * s:RowGap()))
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
call tablemode#TableMotion('k')
|
call tablemode#TableMotion('k')
|
||||||
@@ -819,15 +817,15 @@ function! tablemode#TableMotion(direction) "{{{2
|
|||||||
endif
|
endif
|
||||||
elseif a:direction ==# 'j'
|
elseif a:direction ==# 'j'
|
||||||
if tablemode#IsATableRow(line('.') + s:RowGap())
|
if tablemode#IsATableRow(line('.') + s:RowGap())
|
||||||
execute 'normal ' . s:RowGap() . 'j'
|
execute 'normal! ' . s:RowGap() . 'j'
|
||||||
elseif tablemode#IsATableHeader(line('.') + s:RowGap())
|
elseif tablemode#IsATableHeader(line('.') + s:RowGap()) && tablemode#IsATableRow(line('.') + 2 * s:RowGap())
|
||||||
execute 'normal ' . (s:RowGap() + 1) . 'j'
|
execute 'normal! ' . (s:RowGap() + 1) . 'j'
|
||||||
endif
|
endif
|
||||||
elseif a:direction ==# 'k'
|
elseif a:direction ==# 'k'
|
||||||
if tablemode#IsATableRow(line('.') - s:RowGap())
|
if tablemode#IsATableRow(line('.') - s:RowGap())
|
||||||
execute 'normal ' . s:RowGap() . 'k'
|
execute 'normal! ' . s:RowGap() . 'k'
|
||||||
elseif tablemode#IsATableHeader(line('.') - s:RowGap())
|
elseif tablemode#IsATableHeader(line('.') - s:RowGap()) && tablemode#IsATableRow(line('.') - 2 * s:RowGap())
|
||||||
execute 'normal ' . (s:RowGap() + 1) . 'k'
|
execute 'normal! ' . (s:RowGap() + 1) . 'k'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user