diff options
author | Lewis Russell <lewis6991@gmail.com> | 2022-12-19 16:37:45 +0000 |
---|---|---|
committer | Famiu Haque <famiuhaque@proton.me> | 2023-05-21 15:14:01 +0600 |
commit | 1fe1bb084d0099fc4f9bfdc11189485d0f74b75a (patch) | |
tree | ec823587a4c7ea6991330f6db362846e0fb7bc21 /test/functional/legacy | |
parent | e3e6fadfd82861471c32fdcabe00bbef3de84563 (diff) | |
download | rneovim-1fe1bb084d0099fc4f9bfdc11189485d0f74b75a.tar.gz rneovim-1fe1bb084d0099fc4f9bfdc11189485d0f74b75a.tar.bz2 rneovim-1fe1bb084d0099fc4f9bfdc11189485d0f74b75a.zip |
refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: famiu <famiuhaque@protonmail.com>
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/012_directory_spec.lua | 13 | ||||
-rw-r--r-- | test/functional/legacy/autocmd_option_spec.lua | 12 | ||||
-rw-r--r-- | test/functional/legacy/buffer_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/cmdline_spec.lua | 14 | ||||
-rw-r--r-- | test/functional/legacy/filechanged_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/legacy/messages_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/legacy/vimscript_spec.lua | 2 |
7 files changed, 26 insertions, 27 deletions
diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua index 050e3855fe..f44ba10f7f 100644 --- a/test/functional/legacy/012_directory_spec.lua +++ b/test/functional/legacy/012_directory_spec.lua @@ -15,7 +15,6 @@ local clear = helpers.clear local insert = helpers.insert local command = helpers.command local write_file = helpers.write_file -local curbufmeths = helpers.curbufmeths local expect_exit = helpers.expect_exit local mkdir = helpers.mkdir @@ -58,9 +57,9 @@ describe("'directory' option", function() line 3 Abcdefghij end of testfile]]) - meths.set_option('swapfile', true) - curbufmeths.set_option('swapfile', true) - meths.set_option('directory', '.') + meths.set_option_value('swapfile', true, {}) + meths.set_option_value('swapfile', true, {buf=0}) + meths.set_option_value('directory', '.', {}) -- sanity check: files should not exist yet. eq(nil, luv.fs_stat('.Xtest1.swp')) @@ -72,7 +71,7 @@ describe("'directory' option", function() -- reading the output from :!ls. neq(nil, luv.fs_stat('.Xtest1.swp')) - meths.set_option('directory', './Xtest2,.') + meths.set_option_value('directory', './Xtest2,.', {}) command('edit Xtest1') poke_eventloop() @@ -81,10 +80,10 @@ describe("'directory' option", function() eq({ "Xtest1.swp", "Xtest3" }, ls_dir_sorted("Xtest2")) - meths.set_option('directory', 'Xtest.je') + meths.set_option_value('directory', 'Xtest.je', {}) command('bdelete') command('edit Xtest2/Xtest3') - eq(true, curbufmeths.get_option('swapfile')) + eq(true, meths.get_option_value('swapfile', {buf=0})) poke_eventloop() eq({ "Xtest3" }, ls_dir_sorted("Xtest2")) diff --git a/test/functional/legacy/autocmd_option_spec.lua b/test/functional/legacy/autocmd_option_spec.lua index e00b468c16..8f17f509f5 100644 --- a/test/functional/legacy/autocmd_option_spec.lua +++ b/test/functional/legacy/autocmd_option_spec.lua @@ -631,24 +631,24 @@ describe('au OptionSet', function() it('should trigger if a boolean option be set globally', function() set_hook('autochdir') - nvim.set_option('autochdir', true) - eq(true, nvim.get_option('autochdir')) + nvim.set_option_value('autochdir', true, {scope='global'}) + eq(true, nvim.get_option_value('autochdir', {scope='global'})) expected_combination({'autochdir', 0, '', 0, 1, 'global', 'setglobal'}) end) it('should trigger if a number option be set globally', function() set_hook('cmdheight') - nvim.set_option('cmdheight', 5) - eq(5, nvim.get_option('cmdheight')) + nvim.set_option_value('cmdheight', 5, {scope='global'}) + eq(5, nvim.get_option_value('cmdheight', {scope='global'})) expected_combination({'cmdheight', 1, '', 1, 5, 'global', 'setglobal'}) end) it('should trigger if a string option be set globally', function() set_hook('ambiwidth') - nvim.set_option('ambiwidth', 'double') - eq('double', nvim.get_option('ambiwidth')) + nvim.set_option_value('ambiwidth', 'double', {scope='global'}) + eq('double', nvim.get_option_value('ambiwidth', {scope='global'})) expected_combination({'ambiwidth', 'single', '', 'single', 'double', 'global', 'setglobal'}) end) end) diff --git a/test/functional/legacy/buffer_spec.lua b/test/functional/legacy/buffer_spec.lua index acaa9a51f1..1e8909f0d0 100644 --- a/test/functional/legacy/buffer_spec.lua +++ b/test/functional/legacy/buffer_spec.lua @@ -10,7 +10,7 @@ describe('buffer', function() before_each(function() clear() meths.ui_attach(80, 24, {}) - meths.set_option('hidden', false) + meths.set_option_value('hidden', false, {}) end) it('deleting a modified buffer with :confirm', function() diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua index f7df6ae8d7..3cbff2a01b 100644 --- a/test/functional/legacy/cmdline_spec.lua +++ b/test/functional/legacy/cmdline_spec.lua @@ -225,9 +225,9 @@ describe('cmdline', function() [3] = {reverse = true}, -- TabLineFill }) screen:attach() - meths.set_option('laststatus', 2) - meths.set_option('showtabline', 2) - meths.set_option('cmdheight', 1) + meths.set_option_value('laststatus', 2, {}) + meths.set_option_value('showtabline', 2, {}) + meths.set_option_value('cmdheight', 1, {}) screen:expect([[ {2: [No Name] }{3: }| ^ | @@ -247,10 +247,10 @@ describe('cmdline', function() [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText } screen:attach() - meths.set_option('ruler', true) - meths.set_option('rulerformat', 'longish') - meths.set_option('laststatus', 0) - meths.set_option('winwidth', 1) + meths.set_option_value('ruler', true, {}) + meths.set_option_value('rulerformat', 'longish', {}) + meths.set_option_value('laststatus', 0, {}) + meths.set_option_value('winwidth', 1, {}) feed [[<C-W>v<C-W>|<C-W>p]] screen:expect [[ │^ | diff --git a/test/functional/legacy/filechanged_spec.lua b/test/functional/legacy/filechanged_spec.lua index cea1d6ac30..c8e772f597 100644 --- a/test/functional/legacy/filechanged_spec.lua +++ b/test/functional/legacy/filechanged_spec.lua @@ -12,8 +12,8 @@ describe('file changed dialog', function() before_each(function() clear() meths.ui_attach(80, 24, {}) - meths.set_option('autoread', false) - meths.set_option('fsync', true) + meths.set_option_value('autoread', false, {}) + meths.set_option_value('fsync', true, {}) end) it('works', function() diff --git a/test/functional/legacy/messages_spec.lua b/test/functional/legacy/messages_spec.lua index 71a53c8381..794676153c 100644 --- a/test/functional/legacy/messages_spec.lua +++ b/test/functional/legacy/messages_spec.lua @@ -361,9 +361,9 @@ describe('messages', function() screen:attach() command('cd '..nvim_dir) - meths.set_option('shell', './shell-test') - meths.set_option('shellcmdflag', 'REP 20') - meths.set_option('shellxquote', '') -- win: avoid extra quotes + meths.set_option_value('shell', './shell-test', {}) + meths.set_option_value('shellcmdflag', 'REP 20', {}) + meths.set_option_value('shellxquote', '', {}) -- win: avoid extra quotes -- display a page and go back, results in exactly the same view feed([[:4 verbose echo system('foo')<CR>]]) diff --git a/test/functional/legacy/vimscript_spec.lua b/test/functional/legacy/vimscript_spec.lua index f59a87f824..16a1080396 100644 --- a/test/functional/legacy/vimscript_spec.lua +++ b/test/functional/legacy/vimscript_spec.lua @@ -12,7 +12,7 @@ describe('Vim script', function() it('Error when if/for/while/try/function is nested too deep',function() local screen = Screen.new(80, 24) screen:attach() - meths.set_option('laststatus', 2) + meths.set_option_value('laststatus', 2, {}) exec([[ " Deep nesting of if ... endif func Test1() |