Skip to content

Commit

Permalink
version 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cosminadrianpopescu committed Nov 22, 2017
1 parent 33f14d5 commit 9bbc9e3
Show file tree
Hide file tree
Showing 15 changed files with 1,468 additions and 397 deletions.
317 changes: 266 additions & 51 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion autoload/ctrlp/sw_profiles.vim
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function! ctrlp#sw_profiles#exit()
endfunction

function! ctrlp#sw_profiles#init()
let profiles = sw#profiles#get()
let profiles = sw#cache_get('profiles')

let result = []
for key in keys(profiles)
Expand Down
39 changes: 38 additions & 1 deletion autoload/sw.vim
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ if exists('g:sw_config_dir') && !(g:sw_config_dir =~ '\v\/$')
let g:sw_config_dir .= '/'
endif

function! s:get_cache_folder()
return g:sw_cache . '/'
endfunction

function! sw#find_buffer_by_unique_id(uid)
for k in keys(g:sw_session)
if has_key(g:sw_session[k], 'unique_id')
Expand Down Expand Up @@ -429,7 +433,7 @@ function! sw#parse_macro_xml()
endfunction

function! sw#autocomplete_profile(ArgLead, CmdLine, CursorPos)
let profiles = sw#profiles#get()
let profiles = sw#cache_get('profiles')

let result = []

Expand Down Expand Up @@ -570,3 +574,36 @@ function! sw#execute_file(file)
execute line
endfor
endfunction

function! sw#cache_get(idx)
call sw#execute_file(s:get_cache_folder() . a:idx . '.vim')
return exists('b:' . a:idx) ? getbufvar('%', a:idx) : {}
endfunction

function! sw#to_clipboard(txt)
let clip = &clipboard
let reg = clip =~ '\cunnamedplus' ? '+' : '"'
let cmd = "let @" . reg . '=a:txt'
execute cmd
endfunction

function! sw#eliminate_sql_comments(sql)
let sql = sw#get_sql_canonical(a:sql)[0]
let sql = substitute(sql, '\v--.{-}#NEWLINE#', '#NEWLINE#', 'g')
let sql = substitute(sql, '\v--.{-}$', '', 'g')
let sql = substitute(sql, '\v\/\*.{-}\*\/', '', 'g')
let sql = substitute(sql, '#NEWLINE#', ' ', 'g')

return sql
endfunction


function! sw#get_buffer_from_resultset(channel)
for info in getbufinfo()
if getbufvar(info['bufnr'], 'sw_channel') == a:channel
return info
endif
endfor

return {}
endfunction
Loading

0 comments on commit 9bbc9e3

Please sign in to comment.