66" Licence: BSD-3-Clause
77" ==============================================================
88
9- let s: positions = {
10- \ ' current' : ' edit' ,
11- \ ' tab' : ' tabedit' ,
12- \ ' top' : ' leftabove split' ,
13- \ ' bottom' : ' rightbelow split' ,
14- \ ' left' : ' leftabove vsplit' ,
15- \ ' right' : ' rightbelow vsplit' ,
16- \ ' top-full' : ' topleft split' ,
17- \ ' bottom-full' : ' botright split' ,
18- \ ' left-full' : ' topleft vsplit' ,
19- \ ' right-full' : ' botright vsplit'
20- \ }
21-
229let s: errors_messages = {
2310 \ ' directory' : " Directory '{directory}' does not exists!" ,
2411 \ ' file' : " File '{file}' does not exists!" ,
@@ -71,7 +58,7 @@ func! i18n_rails#translations(has_selection) abort
7158 endif
7259endfunc
7360
74- func ! i18n_rails#open (has_selection, split ) abort
61+ func ! i18n_rails#open (has_selection, mods ) abort
7562 let l: locale_directory = s: locale_directory ()
7663 if ! isdirectory (l: locale_directory )
7764 call s: show_error (s: errors_messages .directory , { ' directory' : l: locale_directory }) | return
@@ -91,7 +78,7 @@ func! i18n_rails#open(has_selection, split) abort
9178 if s: is_empty (l: line_number )
9279 call s: show_error (s: errors_messages .translation, { ' locale_key' : l: locale_key })
9380 else
94- call s: open_locale (l: locale_file , a: split )
81+ call s: open_locale (l: locale_file , a: mods )
9582 call s: goto_line (l: line_number )
9683 endif
9784endfunc
@@ -212,17 +199,8 @@ func! s:selection()
212199 endtry
213200endfunc
214201
215- func ! s: open_locale (locale_file, split ) abort
216- let l: position = s: position (a: split )
217- silent exec l: split . a: locale_file
218- endfunc
219-
220- func ! s: position (split )
221- if len (a: split )
222- return a: split . ' split'
223- endif
224-
225- return get (s: positions , g: i18n_rails_position , s: positions .tab )
202+ func ! s: open_locale (locale_file, mods) abort
203+ silent exec a: mods . ' split ' . a: locale_file
226204endfunc
227205
228206func ! s: goto_line (line_number)
0 commit comments