|
|
@ -11,26 +11,18 @@ endif
|
|
|
|
g:autoloaded_Banana = 1
|
|
|
|
g:autoloaded_Banana = 1
|
|
|
|
|
|
|
|
|
|
|
|
export def Enc()
|
|
|
|
export def Enc()
|
|
|
|
if line("'<") > 0
|
|
|
|
|
|
|
|
call ReplSel(Dec2Ban(GetSel()))
|
|
|
|
call ReplSel(Dec2Ban(GetSel()))
|
|
|
|
else
|
|
|
|
|
|
|
|
call EncLine()
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
enddef
|
|
|
|
enddef
|
|
|
|
|
|
|
|
|
|
|
|
def EncLine()
|
|
|
|
export def EncLine()
|
|
|
|
call setline('.', substitute(getline('.'), '\d\d*', '\=toupper(Doban(submatch(0)))', 'g'))
|
|
|
|
call setline('.', substitute(getline('.'), '\d\d*', '\=toupper(Doban(submatch(0)))', 'g'))
|
|
|
|
enddef
|
|
|
|
enddef
|
|
|
|
|
|
|
|
|
|
|
|
export def Dec()
|
|
|
|
export def Dec()
|
|
|
|
if line("'<") > 0
|
|
|
|
|
|
|
|
call ReplSel(Ban2Dec(GetSel()))
|
|
|
|
call ReplSel(Ban2Dec(GetSel()))
|
|
|
|
else
|
|
|
|
|
|
|
|
call DecLine()
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
enddef
|
|
|
|
enddef
|
|
|
|
|
|
|
|
|
|
|
|
def DecLine()
|
|
|
|
export def DecLine()
|
|
|
|
call setline('.', substitute(getline('.'), '\C\u\u*', '\=Unban(tolower(submatch(0)))', 'g'))
|
|
|
|
call setline('.', substitute(getline('.'), '\C\u\u*', '\=Unban(tolower(submatch(0)))', 'g'))
|
|
|
|
enddef
|
|
|
|
enddef
|
|
|
|
|
|
|
|
|
|
|
@ -105,7 +97,7 @@ def ReplSel(str: string)
|
|
|
|
var new_str = slice(lines[0], 0, cstart - 1) .. str .. lines[-1][cend : ]
|
|
|
|
var new_str = slice(lines[0], 0, cstart - 1) .. str .. lines[-1][cend : ]
|
|
|
|
var new_str_lst = split(new_str, '\n')
|
|
|
|
var new_str_lst = split(new_str, '\n')
|
|
|
|
call setline(lstart, new_str_lst)
|
|
|
|
call setline(lstart, new_str_lst)
|
|
|
|
delmarks < >
|
|
|
|
setcursorcharpos(lstart, cstart)
|
|
|
|
enddef
|
|
|
|
enddef
|
|
|
|
|
|
|
|
|
|
|
|
def Dec2Ban(text: string): string
|
|
|
|
def Dec2Ban(text: string): string
|
|
|
|