-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(mini.misc) FEATURE: implement
setup_restore_cursor()
.
Co-authored-by: Evgeni Chasnovski <[email protected]>
- Loading branch information
1 parent
e742f41
commit 5be4676
Showing
6 changed files
with
255 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
dofile('scripts/minimal_init.lua') | ||
|
||
-- Enable reading correct shada file | ||
vim.o.shadafile = 'tests/dir-misc/restore-cursor.shada' | ||
|
||
-- Set testable size | ||
vim.o.lines = 10 | ||
vim.o.columns = 20 | ||
|
||
-- Set up tested functionality based on test type | ||
local test_type = vim.env.RESTORE_CURSOR_TEST_TYPE | ||
|
||
if test_type == 'set-not-normal-buftype' then vim.cmd('au BufReadPost * set buftype=help') end | ||
if test_type == 'set-position' then vim.cmd('au BufReadPost * call cursor(4, 0)') end | ||
if test_type == 'make-folds' then vim.cmd('au BufReadPost * 2,3 fold | 9,10 fold') end | ||
|
||
local opts = {} | ||
if test_type == 'not-center' then opts = { center = false } end | ||
if test_type == 'ignore-lua' then opts = { ignore_filetype = { 'lua' } } end | ||
|
||
require('mini.misc').setup_restore_cursor(opts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa | ||
-- aaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters