mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Merge pull request #158 from I-am-the-doctor/fix-delete
Fix repeated deletions of rows and columns
This commit is contained in:
@@ -100,8 +100,8 @@ onoremap <silent> <Plug>(table-mode-cell-text-object-i) :<C-U>call tablemode#spr
|
|||||||
xnoremap <silent> <Plug>(table-mode-cell-text-object-a) :<C-U>call tablemode#spreadsheet#cell#TextObject(0)<CR>
|
xnoremap <silent> <Plug>(table-mode-cell-text-object-a) :<C-U>call tablemode#spreadsheet#cell#TextObject(0)<CR>
|
||||||
xnoremap <silent> <Plug>(table-mode-cell-text-object-i) :<C-U>call tablemode#spreadsheet#cell#TextObject(1)<CR>
|
xnoremap <silent> <Plug>(table-mode-cell-text-object-i) :<C-U>call tablemode#spreadsheet#cell#TextObject(1)<CR>
|
||||||
|
|
||||||
nnoremap <silent> <Plug>(table-mode-delete-row) :call tablemode#spreadsheet#DeleteRow()<CR>
|
nnoremap <silent> <Plug>(table-mode-delete-row) :<C-U>call tablemode#spreadsheet#DeleteRow()<CR>
|
||||||
nnoremap <silent> <Plug>(table-mode-delete-column) :call tablemode#spreadsheet#DeleteColumn()<CR>
|
nnoremap <silent> <Plug>(table-mode-delete-column) :<C-U>call tablemode#spreadsheet#DeleteColumn()<CR>
|
||||||
|
|
||||||
nnoremap <silent> <Plug>(table-mode-add-formula) :call tablemode#spreadsheet#formula#Add()<CR>
|
nnoremap <silent> <Plug>(table-mode-add-formula) :call tablemode#spreadsheet#formula#Add()<CR>
|
||||||
nnoremap <silent> <Plug>(table-mode-eval-formula) :call tablemode#spreadsheet#formula#EvaluateFormulaLine()<CR>
|
nnoremap <silent> <Plug>(table-mode-eval-formula) :call tablemode#spreadsheet#formula#EvaluateFormulaLine()<CR>
|
||||||
|
|||||||
7
t/fixtures/big_sample.txt
Normal file
7
t/fixtures/big_sample.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|---+---+---+---|
|
||||||
|
| 1 | 9 | a | z |
|
||||||
|
| 2 | 8 | b | y |
|
||||||
|
| 3 | 7 | c | x |
|
||||||
|
| 4 | 6 | d | w |
|
||||||
|
| 5 | 5 | e | v |
|
||||||
|
|---+---+---+---|
|
||||||
@@ -102,4 +102,25 @@ describe 'spreadsheet'
|
|||||||
Expect tablemode#spreadsheet#ColumnCount('.') == 1
|
Expect tablemode#spreadsheet#ColumnCount('.') == 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'Repeated Manipulations'
|
||||||
|
before
|
||||||
|
new
|
||||||
|
normal! ggdG
|
||||||
|
read t/fixtures/big_sample.txt
|
||||||
|
call cursor(2, 3)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should delete multiple rows correctly'
|
||||||
|
Expect tablemode#spreadsheet#RowCount('.') == 5
|
||||||
|
.,.+1 call tablemode#spreadsheet#DeleteRow()
|
||||||
|
Expect tablemode#spreadsheet#RowCount('.') == 3
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should delete multiple columns correctly'
|
||||||
|
Expect tablemode#spreadsheet#ColumnCount('.') == 4
|
||||||
|
.,.+1 call tablemode#spreadsheet#DeleteColumn()
|
||||||
|
Expect tablemode#spreadsheet#ColumnCount('.') == 2
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user