Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions plugin/oscyank.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

" -------------------- INIT --------------------------------
if exists('g:loaded_oscyank')
finish
Expand Down Expand Up @@ -38,6 +39,12 @@ function s:echo(text, hl)
echohl None
endfunction

if exists(*base64_encode')
function s:encode_b64(str, size)
return a:size <= 0 ?
\ base64_encode(a:str) : strpart(base64_encode(a:str), a:size)
endfunction
else
function s:encode_b64(str, size)
let bytes = map(range(len(a:str)), 'char2nr(a:str[v:val])')
let b64 = []
Expand Down Expand Up @@ -74,6 +81,7 @@ function s:encode_b64(str, size)

return chunked
endfunction
endif

function s:get_text(mode, type)
" Save user settings
Expand Down