Skip to content

Commit bff0d8c

Browse files
authored
Merge pull request #435 from vim-jp/revital-doc
Replace deprecated vital#of({plugin-name}) with vital#{plugin-name}#new()
2 parents c6287a5 + 2dba052 commit bff0d8c

File tree

97 files changed

+163
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+163
-160
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- open()
55
- is_cmdwin()
66
Use Vim.Buffer's one instead.
7+
aabb291268c0977e1444b0901e816db4467d6806
8+
Modules: *
9+
'vital#{plugin-name}#of()' was renamed to 'vital#{plugin-name}#new()'.
710
982d3cb87ef788f4607fc61f1fd20ec2e3975479
811
Modules: Vim.Guard
912
Guard.store() API has changed to take a single List instance instead of arguments, due to the

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Assuming your Vim plugin name is `ujihisa`. You can define your utility
103103
function set `ujihisa#util` just by
104104

105105
```vim
106-
let s:V = vital#of('ujihisa')
106+
let s:V = vital#ujihisa#new()
107107
function! ujihisa#util#system(...)
108108
return call(s:V.system, a:000, s:V)
109109
endfunction
@@ -117,7 +117,7 @@ Vital has module system. The below is an example to import/load a module
117117

118118
```vim
119119
" Recommented way
120-
let s:V = vital#of('ujihisa')
120+
let s:V = vital#ujihisa#new()
121121
let s:O = s:V.import('Data.OrderedSet')
122122
call s:O.f()
123123
```
@@ -126,7 +126,7 @@ or
126126

127127
```vim
128128
" Recommended way only if you rarely use the module
129-
let s:V = vital#of('ujihisa')
129+
let s:V = vital#ujihisa#new()
130130
call s:V.load('Data.OrderedSet')
131131
call s:V.Data.OrderedSet.f()
132132
```
@@ -135,7 +135,7 @@ or
135135

136136
```vim
137137
" Available, but we don't recommend this very much
138-
let s:V = vital#of('ujihisa')
138+
let s:V = vital#ujihisa#new()
139139
call s:V.import('Data.OrderedSet', s:)
140140
call s:f()
141141
```

autoload/vital/_vital.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let s:_plugin_name = expand('<sfile>:t:r')
22

33
function! vital#{s:_plugin_name}#new() abort
4-
return vital#{s:_plugin_name[1:]}#of()
4+
return vital#{s:_plugin_name[1:]}#new()
55
endfunction

autoload/vital/vital.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ else
2121
endfunction
2222
endif
2323

24-
function! vital#{s:plugin_name}#of() abort
24+
function! vital#{s:plugin_name}#new() abort
2525
return s:new(s:plugin_name)
2626
endfunction
2727

@@ -170,7 +170,7 @@ function! s:_import(name) abort dict
170170
let s:loaded[a:name] = export_module
171171
if has_key(module, '_vital_loaded')
172172
try
173-
call module._vital_loaded(vital#{s:plugin_name}#of())
173+
call module._vital_loaded(vital#{s:plugin_name}#new())
174174
catch
175175
unlet s:loaded[a:name]
176176
throw 'vital: fail to call ._vital_loaded(): ' . v:exception

autoload/vitalizer.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let s:LOADER_FILES = [
88
\ 'autoload/vital/vital.vim',
99
\ 'autoload/vital/_vital.vim',
1010
\ ]
11-
let s:V = vital#vital#of()
11+
let s:V = vital#vital#new()
1212
let s:P = s:V.import('Prelude')
1313
let s:L = s:V.import('Data.List')
1414
let s:S = s:V.import('Data.String')

doc/vital-assertion.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ define({assert_command_name}, ...) *Vital.Assertion.define()*
3333

3434
1) Succeeded
3535
>
36-
let s:V = vital#of('vital')
36+
let s:V = vital#{plugin-name}#new()
3737
let s:A = s:V.import('Assertion')
3838
3939
call s:A.define('Assert', 1)
@@ -45,7 +45,7 @@ define({assert_command_name}, ...) *Vital.Assertion.define()*
4545

4646
2) Failed
4747
>
48-
let s:V = vital#of('vital')
48+
let s:V = vital#{plugin-name}#new()
4949
let s:A = s:V.import('Assertion')
5050
5151
call s:A.define('Assert', 1)
@@ -66,7 +66,7 @@ define({assert_command_name}, ...) *Vital.Assertion.define()*
6666

6767
1) Succeeded
6868
>
69-
let s:V = vital#of('vital')
69+
let s:V = vital#{plugin-name}#new()
7070
let s:A = s:V.import('Assertion')
7171
7272
call s:A.define('Assert', 1)
@@ -78,7 +78,7 @@ define({assert_command_name}, ...) *Vital.Assertion.define()*
7878

7979
2) Failed
8080
>
81-
let s:V = vital#of('vital')
81+
let s:V = vital#{plugin-name}#new()
8282
let s:A = s:V.import('Assertion')
8383
8484
call s:A.define('Assert', 1)

doc/vital-concurrent_process.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Note that this usage gives you little benefit to you comparing just to use
6060
system(), vimproc#system(), or Vital.Process.system(). Keep reading other
6161
examples before you try to use this for your own plugin ;)
6262
>
63-
let s:CP = vital#of('vital').import('ConcurrentProcess')
63+
let s:CP = vital#{plugin-name}#new().import('ConcurrentProcess')
6464
6565
function! s:list_files(path) abort
6666
let label = s:CP.of(['ls', a:path], '', [
@@ -92,7 +92,7 @@ Things to learn from this example:
9292

9393
You can give text to stdin as well.
9494
>
95-
let s:CP = vital#of('vital').import('ConcurrentProcess')
95+
let s:CP = vital#{plugin-name}#new().import('ConcurrentProcess')
9696
9797
function! s:with_linenum(text) abort
9898
let label = s:CP.of('cat -n', '', [

doc/vital-data-bignum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ INTRODUCTION *Vital.Data.BigNum-introduction*
1616
It provides some functions to manipulate multi precision integer.
1717

1818
>
19-
let s:V = vital#of("vital")
19+
let s:V = vital#{plugin-name}#new()
2020
let s:BigNum = s:V.import("Data.BigNum")
2121
2222
let x = s:BigNum.from_num(42)

doc/vital-data-closure.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ INTRODUCTION *Vital.Data.Closure-introduction*
1818

1919
*Vital.Data.Closure* provides Closure object.
2020
>
21-
let C = vital#of('vital').import('Data.Closure')
21+
let C = vital#{plugin-name}#new().import('Data.Closure')
2222
<
2323

2424

doc/vital-data-counter.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ INTRODUCTION *Vital.Data.Counter-introduction*
1818
*Vital.Data.Counter* is a counter library to support convenient tallies.
1919

2020
>
21-
let s:V = vital#of('vital')
21+
let s:V = vital#{plugin-name}#new()
2222
let s:Counter = s:V.import('Data.Counter')
2323
let s:Math = s:V.import('Math')
2424

0 commit comments

Comments
 (0)