neovim 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -1
- data/.rubocop.yml +118 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/Rakefile +29 -16
- data/VimFlavor +1 -0
- data/appveyor.yml +2 -0
- data/lib/neovim/api.rb +2 -1
- data/lib/neovim/buffer.rb +7 -15
- data/lib/neovim/client.rb +3 -3
- data/lib/neovim/connection.rb +6 -7
- data/lib/neovim/event_loop.rb +3 -3
- data/lib/neovim/executable.rb +1 -0
- data/lib/neovim/host.rb +12 -12
- data/lib/neovim/line_range.rb +16 -16
- data/lib/neovim/logging.rb +14 -14
- data/lib/neovim/message.rb +7 -7
- data/lib/neovim/plugin/dsl.rb +4 -4
- data/lib/neovim/plugin/handler.rb +3 -3
- data/lib/neovim/remote_object.rb +3 -3
- data/lib/neovim/ruby_provider.rb +11 -15
- data/lib/neovim/ruby_provider/buffer_ext.rb +1 -0
- data/lib/neovim/ruby_provider/vim.rb +14 -2
- data/lib/neovim/ruby_provider/window_ext.rb +1 -0
- data/lib/neovim/session.rb +7 -10
- data/lib/neovim/version.rb +1 -1
- data/lib/neovim/window.rb +3 -3
- data/neovim.gemspec +5 -4
- data/script/{dump_api → dump_api.rb} +0 -0
- data/script/{generate_docs → generate_docs.rb} +0 -0
- data/script/{j2mp → j2mp.rb} +0 -0
- data/script/{mp2j → mp2j.rb} +0 -0
- data/script/run_acceptance.rb +35 -0
- data/script/validate_docs.rb +29 -0
- data/spec/acceptance/rplugin_autocmd_spec.vim +20 -10
- data/spec/acceptance/rplugin_command_spec.vim +54 -56
- data/spec/acceptance/rplugin_function_spec.vim +28 -22
- data/spec/acceptance/ruby_spec.vim +40 -48
- data/spec/acceptance/rubydo_spec.vim +40 -52
- data/spec/acceptance/rubyfile/nested.rb +1 -1
- data/spec/acceptance/rubyfile_spec.vim +57 -63
- data/spec/acceptance/runtime/init.vim +4 -3
- data/spec/acceptance/runtime/rplugin/ruby/autocmds.rb +6 -2
- data/spec/acceptance/runtime/rplugin/ruby/commands.rb +17 -16
- data/spec/acceptance/runtime/rplugin/ruby/functions.rb +8 -8
- data/spec/helper.rb +2 -2
- data/spec/neovim/api_spec.rb +1 -1
- data/spec/neovim/client_spec.rb +10 -10
- data/spec/neovim/connection_spec.rb +5 -6
- data/spec/neovim/current_spec.rb +12 -12
- data/spec/neovim/executable_spec.rb +2 -2
- data/spec/neovim/host/loader_spec.rb +2 -2
- data/spec/neovim/host_spec.rb +7 -7
- data/spec/neovim/line_range_spec.rb +16 -16
- data/spec/neovim/logging_spec.rb +7 -7
- data/spec/neovim/plugin_spec.rb +6 -6
- data/spec/neovim/ruby_provider/buffer_ext_spec.rb +2 -2
- data/spec/neovim/ruby_provider/vim_spec.rb +4 -4
- data/spec/neovim/ruby_provider/window_ext_spec.rb +8 -8
- data/spec/neovim/session_spec.rb +8 -8
- data/spec/neovim/window_spec.rb +0 -1
- metadata +41 -27
- data/.gitmodules +0 -3
- data/.rspec +0 -1
- data/spec/acceptance/runtime/vader.vim/autoload/vader.vim +0 -348
- data/spec/acceptance/runtime/vader.vim/autoload/vader/assert.vim +0 -116
- data/spec/acceptance/runtime/vader.vim/autoload/vader/helper.vim +0 -43
- data/spec/acceptance/runtime/vader.vim/autoload/vader/parser.vim +0 -179
- data/spec/acceptance/runtime/vader.vim/autoload/vader/syntax.vim +0 -73
- data/spec/acceptance/runtime/vader.vim/autoload/vader/window.vim +0 -205
- data/spec/acceptance/runtime/vader.vim/plugin/vader.vim +0 -37
- data/spec/acceptance_spec.rb +0 -85
data/script/{j2mp → j2mp.rb}
RENAMED
File without changes
|
data/script/{mp2j → mp2j.rb}
RENAMED
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
ENV.delete("VIM")
|
6
|
+
ENV.delete("VIMRUNTIME")
|
7
|
+
|
8
|
+
acceptance_root = File.expand_path("../../spec/acceptance", __FILE__)
|
9
|
+
themis_rtp = File.join(acceptance_root, "runtime")
|
10
|
+
themis_home = File.join(themis_rtp, "flavors/thinca_vim-themis")
|
11
|
+
manifest = File.join(themis_rtp, "rplugin_manifest.vim")
|
12
|
+
vimrc = File.join(themis_rtp, "init.vim")
|
13
|
+
|
14
|
+
themis_exe = Gem.win_platform? ?
|
15
|
+
File.join(themis_home, "bin/themis.bat") :
|
16
|
+
File.join(themis_home, "bin/themis")
|
17
|
+
|
18
|
+
env = {
|
19
|
+
"NVIM_RPLUGIN_MANIFEST" => manifest,
|
20
|
+
"THEMIS_VIM" => "nvim",
|
21
|
+
"THEMIS_HOME" => themis_home,
|
22
|
+
"THEMIS_ARGS" => "-e -s --headless -u #{vimrc}"
|
23
|
+
}
|
24
|
+
|
25
|
+
FileUtils.rm_f(manifest)
|
26
|
+
|
27
|
+
system(
|
28
|
+
env,
|
29
|
+
"nvim",
|
30
|
+
"-e", "-s", "--headless",
|
31
|
+
"-u", vimrc,
|
32
|
+
"+UpdateRemotePlugins", "+qa!"
|
33
|
+
)
|
34
|
+
|
35
|
+
exec(env, themis_exe, *ARGV)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require "open-uri"
|
5
|
+
|
6
|
+
url = "https://api.github.com/repos/neovim/neovim/releases/latest"
|
7
|
+
|
8
|
+
begin
|
9
|
+
response = open(url) { |res| JSON.parse(res.read) }
|
10
|
+
rescue SocketError, OpenURI::HTTPError => e
|
11
|
+
puts "Request failed: #{e}\n"
|
12
|
+
exit
|
13
|
+
end
|
14
|
+
|
15
|
+
release_version = response["name"][/NVIM v?(.+)$/, 1]
|
16
|
+
|
17
|
+
client_file = File.read(
|
18
|
+
File.expand_path("../../lib/neovim/client.rb", __FILE__)
|
19
|
+
)
|
20
|
+
docs_version = client_file[
|
21
|
+
/The methods documented here were generated using NVIM v?(.+)$/,
|
22
|
+
1
|
23
|
+
]
|
24
|
+
|
25
|
+
if docs_version == release_version
|
26
|
+
puts "Documentation is up-to-date."
|
27
|
+
else
|
28
|
+
abort "Documentation is out of date: expected #{release_version}, got #{docs_version}."
|
29
|
+
end
|
@@ -1,18 +1,28 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
let s:suite = themis#suite("Remote plugin autocmd")
|
2
|
+
let s:expect = themis#helper("expect")
|
3
3
|
|
4
|
-
|
4
|
+
function! s:suite.has_nvim() abort
|
5
|
+
call s:expect(has("nvim")).to_equal(1)
|
6
|
+
endfunction
|
7
|
+
|
8
|
+
function! s:suite.triggers_for_matched_pattern() abort
|
5
9
|
silent split file.rb
|
6
|
-
|
7
|
-
|
10
|
+
call s:expect(b:rplugin_autocmd_BufEnter).to_equal(v:true)
|
11
|
+
endfunction
|
8
12
|
|
9
|
-
|
13
|
+
function! s:suite.doesnt_trigger_for_unmatched_pattern() abort
|
10
14
|
silent split file.py
|
11
|
-
|
12
|
-
|
15
|
+
call s:expect(exists('b:rplugin_autocmd_BufEnter')).to_equal(0)
|
16
|
+
endfunction
|
13
17
|
|
14
|
-
|
18
|
+
function! s:suite.supports_eval() abort
|
15
19
|
let g:to_eval = {'a': 42}
|
16
20
|
silent split file.c
|
21
|
+
call s:expect(g:rplugin_autocmd_BufEnter_eval).to_equal({'a': 42, 'b': 43})
|
22
|
+
endfunction
|
23
|
+
|
24
|
+
function! s:suite.supports_async() abort
|
25
|
+
silent split file.async
|
17
26
|
sleep 50m
|
18
|
-
|
27
|
+
call s:expect(g:rplugin_autocmd_BufEnter_async).to_equal(v:true)
|
28
|
+
endfunction
|
@@ -1,7 +1,17 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
let s:suite = themis#suite("Remote plugin command")
|
2
|
+
let s:expect = themis#helper("expect")
|
3
3
|
|
4
|
-
|
4
|
+
function! s:suite.before_each() abort
|
5
|
+
1,$delete
|
6
|
+
call append(0, ["one", "two", "three"])
|
7
|
+
normal gg
|
8
|
+
endfunction
|
9
|
+
|
10
|
+
function! s:suite.has_nvim() abort
|
11
|
+
call s:expect(has("nvim")).to_equal(1)
|
12
|
+
endfunction
|
13
|
+
|
14
|
+
function! s:suite.supports_arguments() abort
|
5
15
|
RPluginCommandNargs0
|
6
16
|
RPluginCommandNargs1 1
|
7
17
|
RPluginCommandNargsN
|
@@ -11,91 +21,79 @@ Execute (Call rplugin commands with arguments):
|
|
11
21
|
RPluginCommandNargsQ 1
|
12
22
|
RPluginCommandNargsP 1
|
13
23
|
RPluginCommandNargsP 1 2
|
14
|
-
sleep 100m
|
15
|
-
|
16
|
-
Then:
|
17
|
-
AssertEqual v:true, g:rplugin_command_nargs_0
|
18
|
-
AssertEqual "1", g:rplugin_command_nargs_1
|
19
|
-
AssertEqual ["1", "2"], g:rplugin_command_nargs_n
|
20
|
-
AssertEqual "1", g:rplugin_command_nargs_q
|
21
|
-
AssertEqual ["1", "2"], g:rplugin_command_nargs_p
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
call s:expect(g:rplugin_command_nargs_0).to_equal(v:true)
|
26
|
+
call s:expect(g:rplugin_command_nargs_1).to_equal("1")
|
27
|
+
call s:expect(g:rplugin_command_nargs_n).to_equal(["1", "2"])
|
28
|
+
call s:expect(g:rplugin_command_nargs_q).to_equal("1")
|
29
|
+
call s:expect(g:rplugin_command_nargs_p).to_equal(["1", "2"])
|
30
|
+
endfunction
|
27
31
|
|
28
|
-
|
32
|
+
function! s:suite.supports_line_range() abort
|
29
33
|
RPluginCommandRange
|
30
|
-
|
31
|
-
AssertEqual [1, 1], g:rplugin_command_range
|
34
|
+
call s:expect(g:rplugin_command_range).to_equal([1, 1])
|
32
35
|
|
33
36
|
1,2RPluginCommandRange
|
34
|
-
|
35
|
-
AssertEqual [1, 2], g:rplugin_command_range
|
37
|
+
call s:expect(g:rplugin_command_range).to_equal([1, 2])
|
36
38
|
|
37
39
|
%RPluginCommandRange
|
38
|
-
|
39
|
-
AssertEqual [1, 3], g:rplugin_command_range
|
40
|
+
call s:expect(g:rplugin_command_range).to_equal([1, 4])
|
40
41
|
|
41
42
|
RPluginCommandRangeP
|
42
|
-
|
43
|
-
AssertEqual [1, 3], g:rplugin_command_range_p
|
43
|
+
call s:expect(g:rplugin_command_range_p).to_equal([1, 4])
|
44
44
|
|
45
45
|
1,2RPluginCommandRangeP
|
46
|
-
|
47
|
-
AssertEqual [1, 2], g:rplugin_command_range_p
|
46
|
+
call s:expect(g:rplugin_command_range_p).to_equal([1, 2])
|
48
47
|
|
49
48
|
%RPluginCommandRangeP
|
50
|
-
|
51
|
-
AssertEqual [1, 3], g:rplugin_command_range_p
|
49
|
+
call s:expect(g:rplugin_command_range_p).to_equal([1, 4])
|
52
50
|
|
53
51
|
RPluginCommandRangeN
|
54
|
-
|
55
|
-
AssertEqual [1], g:rplugin_command_range_n
|
52
|
+
call s:expect(g:rplugin_command_range_n).to_equal([1])
|
56
53
|
|
57
54
|
2RPluginCommandRangeN
|
58
|
-
|
59
|
-
|
55
|
+
call s:expect(g:rplugin_command_range_n).to_equal([2])
|
56
|
+
endfunction
|
60
57
|
|
61
|
-
|
58
|
+
function! s:suite.supports_count() abort
|
62
59
|
RPluginCommandCountN
|
63
|
-
|
64
|
-
AssertEqual [1], g:rplugin_command_count_n
|
60
|
+
call s:expect(g:rplugin_command_count_n).to_equal([1])
|
65
61
|
|
66
62
|
2RPluginCommandCountN
|
67
|
-
|
68
|
-
|
63
|
+
call s:expect(g:rplugin_command_count_n).to_equal([2])
|
64
|
+
endfunction
|
69
65
|
|
70
|
-
|
66
|
+
function! s:suite.supports_bang() abort
|
71
67
|
RPluginCommandBang
|
72
|
-
|
73
|
-
AssertEqual 0, g:rplugin_command_bang
|
68
|
+
call s:expect(g:rplugin_command_bang).to_equal(0)
|
74
69
|
|
75
70
|
RPluginCommandBang!
|
76
|
-
|
77
|
-
|
71
|
+
call s:expect(g:rplugin_command_bang).to_equal(1)
|
72
|
+
endfunction
|
78
73
|
|
79
|
-
|
74
|
+
function! s:suite.supports_register() abort
|
80
75
|
RPluginCommandRegister a
|
81
|
-
|
82
|
-
|
76
|
+
call s:expect(g:rplugin_command_register).to_equal("a")
|
77
|
+
endfunction
|
83
78
|
|
84
|
-
|
79
|
+
function! s:suite.supports_completion() abort
|
85
80
|
RPluginCommandCompletion
|
86
|
-
|
87
|
-
|
81
|
+
call s:expect(g:rplugin_command_completion).to_equal("buffer")
|
82
|
+
endfunction
|
88
83
|
|
89
|
-
|
84
|
+
function! s:suite.supports_eval() abort
|
90
85
|
let g:to_eval = {'a': 42}
|
91
86
|
RPluginCommandEval
|
92
|
-
|
93
|
-
|
87
|
+
call s:expect(g:rplugin_command_eval).to_equal({'a': 42, 'b': 43})
|
88
|
+
endfunction
|
94
89
|
|
95
|
-
|
96
|
-
|
97
|
-
|
90
|
+
function! s:suite.supports_asynchronous_commands() abort
|
91
|
+
RPluginCommandAsync
|
92
|
+
sleep 50m
|
93
|
+
call s:expect(g:rplugin_command_async).to_equal(v:true)
|
94
|
+
endfunction
|
98
95
|
|
99
|
-
|
96
|
+
function! s:suite.supports_recursion() abort
|
100
97
|
RPluginCommandRecursive 0
|
101
|
-
|
98
|
+
call s:expect(g:rplugin_command_recursive).to_equal("10")
|
99
|
+
endfunction
|
@@ -1,29 +1,35 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
let s:suite = themis#suite("Remote plugin function")
|
2
|
+
let s:expect = themis#helper("expect")
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
function! s:suite.before_each() abort
|
5
|
+
1,$delete
|
6
|
+
call append(0, ["one", "two", "three"])
|
7
|
+
endfunction
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
three
|
9
|
+
function! s:suite.has_nvim() abort
|
10
|
+
call s:expect(has("nvim")).to_equal(1)
|
11
|
+
endfunction
|
13
12
|
|
14
|
-
|
15
|
-
1,
|
16
|
-
|
17
|
-
|
13
|
+
function! s:suite.supports_arguments() abort
|
14
|
+
call s:expect(RPluginFunctionArgs(1, 2)).to_equal([1, 2])
|
15
|
+
endfunction
|
16
|
+
|
17
|
+
function! s:suite.supports_line_range() abort
|
18
|
+
3,4call RPluginFunctionRange()
|
19
|
+
call s:expect(g:rplugin_function_range).to_equal([3, 4])
|
20
|
+
endfunction
|
18
21
|
|
19
|
-
|
22
|
+
function! s:suite.supports_eval() abort
|
20
23
|
let g:to_eval = {'a': 42}
|
21
|
-
call RPluginFunctionEval()
|
22
|
-
|
23
|
-
AssertEqual {'a': 42, 'b': 43}, g:rplugin_function_eval
|
24
|
+
call s:expect(RPluginFunctionEval()).to_equal({"a": 42, "b": 43})
|
25
|
+
endfunction
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
+
function! s:suite.supports_asynchronous_functions() abort
|
28
|
+
call RPluginFunctionAsync()
|
29
|
+
sleep 50m
|
30
|
+
call s:expect(g:rplugin_function_async).to_equal(v:true)
|
31
|
+
endfunction
|
27
32
|
|
28
|
-
|
29
|
-
|
33
|
+
function! s:suite.supports_recursion() abort
|
34
|
+
call s:expect(RPluginFunctionRecursive(0)).to_equal(10)
|
35
|
+
endfunction
|
@@ -1,92 +1,84 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
Execute (Define a Ruby method):
|
13
|
-
ruby def foo; Vim.command("let g:called = 1"); end
|
1
|
+
let s:suite = themis#suite(":ruby")
|
2
|
+
let s:expect = themis#helper("expect")
|
3
|
+
|
4
|
+
function! s:suite.before_each() abort
|
5
|
+
1,$delete
|
6
|
+
call append(0, ["one", "two"])
|
7
|
+
endfunction
|
8
|
+
|
9
|
+
function! s:suite.has_nvim() abort
|
10
|
+
call s:expect(has("nvim")).to_equal(1)
|
11
|
+
endfunction
|
14
12
|
|
15
|
-
|
13
|
+
function! s:suite.defines_a_ruby_method() abort
|
14
|
+
ruby def foo; Vim.command("let g:called = 1"); end
|
16
15
|
ruby foo
|
17
16
|
|
18
|
-
|
19
|
-
|
17
|
+
call s:expect(g:called).to_equal(1)
|
18
|
+
endfunction
|
20
19
|
|
21
|
-
|
20
|
+
function! s:suite.persists_curbuf_state() abort
|
22
21
|
ruby $curbuf.instance_variable_set(:@foo, 123)
|
23
22
|
ruby Vim.command("let g:foo = #{$curbuf.instance_variable_get(:@foo)}")
|
24
23
|
|
25
|
-
|
26
|
-
|
24
|
+
call s:expect(g:foo).to_equal(123)
|
25
|
+
endfunction
|
27
26
|
|
28
|
-
|
27
|
+
function! s:suite.updates_working_directory() abort
|
29
28
|
cd /
|
30
|
-
ruby Vim.command("let g:ruby_pwd = '#{Dir.pwd.sub(/^C:/,
|
29
|
+
ruby Vim.command("let g:ruby_pwd = '#{Dir.pwd.sub(/^C:/, "")}'")
|
31
30
|
cd -
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
AssertEqual "/", g:ruby_pwd
|
36
|
-
endif
|
32
|
+
call s:expect(g:ruby_pwd).to_equal("/")
|
33
|
+
endfunction
|
37
34
|
|
38
|
-
|
35
|
+
function! s:suite.updates_working_directory_implicitly() abort
|
39
36
|
split | lcd /
|
40
37
|
ruby Vim.command("let g:before_pwd = '#{Dir.pwd}'")
|
41
38
|
wincmd p
|
42
39
|
ruby Vim.command("let g:after_pwd = '#{Dir.pwd}'")
|
43
40
|
wincmd p | lcd -
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
AssertNotEqual g:before_pwd, g:after_pwd
|
48
|
-
endif
|
42
|
+
call s:expect(g:before_pwd).not.to_equal(g:after_pwd)
|
43
|
+
endfunction
|
49
44
|
|
50
|
-
|
45
|
+
function! s:suite.supports_nesting() abort
|
51
46
|
ruby Vim.command("ruby Vim.command('let g:ruby_nested = 123')")
|
52
47
|
|
53
|
-
|
54
|
-
|
48
|
+
call s:expect(g:ruby_nested).to_equal(123)
|
49
|
+
endfunction
|
55
50
|
|
56
|
-
|
51
|
+
function! s:suite.handles_standard_error() abort
|
57
52
|
try
|
58
53
|
ruby raise "BOOM"
|
59
54
|
throw "Nothing raised"
|
60
55
|
catch /BOOM/
|
61
56
|
endtry
|
62
57
|
|
63
|
-
|
64
|
-
|
65
|
-
Expect:
|
66
|
-
still works
|
67
|
-
two
|
58
|
+
call s:suite.defines_a_ruby_method()
|
59
|
+
endfunction
|
68
60
|
|
69
|
-
|
61
|
+
function! s:suite.handles_syntax_error() abort
|
70
62
|
try
|
71
63
|
ruby puts[
|
72
64
|
throw "Nothing raised"
|
73
65
|
catch /SyntaxError/
|
74
66
|
endtry
|
75
67
|
|
76
|
-
|
77
|
-
|
78
|
-
Expect:
|
79
|
-
still works
|
80
|
-
two
|
68
|
+
call s:suite.defines_a_ruby_method()
|
69
|
+
endfunction
|
81
70
|
|
82
|
-
|
71
|
+
function! s:suite.exposes_Vim() abort
|
83
72
|
ruby expect(Vim).to eq(VIM)
|
84
73
|
ruby expect(Vim.strwidth("hi")).to eq(2)
|
74
|
+
endfunction
|
85
75
|
|
86
|
-
|
76
|
+
function! s:suite.exposes_Buffer() abort
|
87
77
|
ruby expect($curbuf).to be_a(Neovim::Buffer)
|
88
78
|
ruby expect(Vim::Buffer.current).to eq($curbuf)
|
79
|
+
endfunction
|
89
80
|
|
90
|
-
|
81
|
+
function! s:suite.exposes_Window() abort
|
91
82
|
ruby expect($curwin).to be_a(Neovim::Window)
|
92
83
|
ruby expect(Vim::Window.current).to eq($curwin)
|
84
|
+
endfunction
|