remove l9

This commit is contained in:
Barak Michener 2012-02-21 14:07:39 -08:00
parent 19a7a837dc
commit c849a1fe05
33 changed files with 0 additions and 1271 deletions

Binary file not shown.

View file

@ -1 +0,0 @@
default

View file

@ -1,2 +0,0 @@
3bb534a720fa762aa01d2df2d5d41bd3c4122169 16
3bb534a720fa762aa01d2df2d5d41bd3c4122169 default

Binary file not shown.

View file

@ -1,2 +0,0 @@
[paths]
default = https://bitbucket.org/ns9tks/vim-l9

View file

@ -1,3 +0,0 @@
revlogv1
store
fncache

View file

@ -1,10 +0,0 @@
data/.hgtags.i
data/autoload/l9.vim.i
data/autoload/l9/async.py.i
data/autoload/l9/async.vim.i
data/autoload/l9/quickfix.vim.i
data/autoload/l9/tempbuffer.vim.i
data/autoload/l9/tempvariables.vim.i
data/doc/l9.jax.i
data/doc/l9.txt.i
data/plugin/l9.vim.i

Binary file not shown.

View file

@ -1,5 +0,0 @@
16 3bb534a720fa762aa01d2df2d5d41bd3c4122169 6aa7a3368a9c199331687b5b0603428056527248
f6420a42fc69dd7fc08aa5426c4b3fb10e78020d 1.0
f6f3e9bae8770abb41259d42ab65721f6915fe22 1.0.1
c3f242518bd4b8131a2c277a7f8c492b56375dff 1.1

View file

@ -1 +0,0 @@
default

View file

@ -1,3 +0,0 @@
f6420a42fc69dd7fc08aa5426c4b3fb10e78020d 1.0
f6f3e9bae8770abb41259d42ab65721f6915fe22 1.0.1
c3f242518bd4b8131a2c277a7f8c492b56375dff 1.1

File diff suppressed because it is too large Load diff

View file

@ -1,92 +0,0 @@
#!/usr/bin/env python
from __future__ import with_statement
import vim
import os
import subprocess
import threading
import Queue
class Asyncer:
def __init__(self):
self._workers = {}
def execute(self, var_key, var_command, var_cwd, var_input, var_appends):
key = vim.eval(var_key)
command = vim.eval(var_command)
cwd = vim.eval(var_cwd)
input = vim.eval(var_input)
appends = vim.eval(var_appends)
if key not in self._workers:
self._workers[key] = Worker()
self._workers[key].start()
self._workers[key].put(Executor(command, cwd, input, appends))
def print_output(self, var_key):
key = vim.eval(var_key)
if key not in self._workers:
return
for l in self._workers[key].copy_outputs():
print l,
def print_worker_keys(self):
for k in self._workers.keys():
print k
def print_active_worker_keys(self):
for k in self._workers.keys():
print k
class Worker(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self._queue = Queue.Queue()
self._lines = []
self._lock = threading.Lock()
def run(self):
while True:
self._queue.get().execute(self)
self._queue.task_done()
def put(self, executor):
self._queue.put(executor)
def clear_outputs(self):
with self._lock:
self._lines = []
def record_output(self, line):
with self._lock:
self._lines.append(line)
def copy_outputs(self):
with self._lock:
return self._lines[:]
class Executor:
def __init__(self, command, cwd, input, appends):
self._command = command
self._cwd = cwd
self._input = input
self._appends = appends
def execute(self, worker):
if not self._appends:
worker.clear_outputs()
os.chdir(self._cwd)
p = subprocess.Popen(self._command, shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p.stdin.write(self._input)
line = p.stdout.readline()
while line:
worker.record_output(line)
line = p.stdout.readline()

View file

@ -1,67 +0,0 @@
"=============================================================================
" Copyright (C) 2009-2010 Takeshi NISHIDA
"
"=============================================================================
" LOAD GUARD {{{1
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, ['has("python")'])
finish
endif
" }}}1
"=============================================================================
" ASYNC EXECUTE {{{1
"
function s:checkKey(key)
if a:key =~ '\n' || a:key !~ '\S'
throw "Asyncer: Invalid key: " . a:key
endif
endfunction
"
function l9#async#execute(key, cmd, cwd, input, appends)
call s:checkKey(a:key)
python asyncer.execute('a:key', 'a:cmd', 'a:cwd', 'a:input', 'a:appends')
endfunction
"
function l9#async#read(key)
call s:checkKey(a:key)
redir => result
silent python asyncer.print_output('a:key')
redir END
" NOTE: "\n" is somehow inserted by redir.
return (result[0] ==# "\n" ? result[1:] : result)
endfunction
"
function l9#async#listWorkers()
redir => result
silent python asyncer.print_worker_keys()
redir END
return split(result, "\n")
endfunction
"
function l9#async#listActiveWorkers()
redir => result
silent python asyncer.print_active_worker_keys()
redir END
return split(result, "\n")
endfunction
" }}}1
"=============================================================================
" INITIALIZATION {{{1
let s:ASYNC_PY_PATH = fnamemodify(expand('<sfile>:p:h'), ':p') . 'async.py'
pyfile `=s:ASYNC_PY_PATH`
python asyncer = Asyncer()
" }}}1
"=============================================================================
" vim: set fdm=marker:

View file

@ -1,107 +0,0 @@
"=============================================================================
" Copyright (C) 2009-2010 Takeshi NISHIDA
"
"=============================================================================
" LOAD GUARD {{{1
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
finish
endif
" }}}1
"=============================================================================
" QUICKFIX {{{1
" Returns non-zero if quickfix window is opened.
function l9#quickfix#isWindowOpened()
return count(map(range(1, winnr('$')), 'getwinvar(v:val, "&buftype")'), 'quickfix') > 0
endfunction
" Opens quickfix window if quickfix is not empty, and echo the number of errors.
"
" a:onlyRecognized: if non-zero, opens only if quickfix has recognized errors.
" a:holdCursor: if non-zero, the cursor won't move to quickfix window.
function l9#quickfix#openIfNotEmpty(onlyRecognized, holdCursor)
let numErrors = len(filter(getqflist(), 'v:val.valid'))
let numOthers = len(getqflist()) - numErrors
if numErrors > 0 || (!a:onlyRecognized && numOthers > 0)
copen
if a:holdCursor
wincmd p
endif
else
cclose
endif
redraw
if numOthers > 0
echo printf('Quickfix: %d(+%d)', numErrors, numOthers)
else
echo printf('Quickfix: %d', numErrors)
endif
endfunction
" Toggles Quickfix window
function l9#quickfix#toggleWindow()
if l9#quickfix#isWindowOpened()
cclose
else
call l9#quickfix#openIfNotEmpty(0, 0)
endif
endfunction
" Creates quickfix list form given lines and opens the quickfix window if
" errors exists.
"
" a:lines:
" a:jump: if non-zero, jump to the first error.
function l9#quickfix#setMakeResult(lines)
cexpr a:lines
call l9#quickfix#openIfNotEmpty(0, 1)
endfunction
" Compares quickfix entries for sorting.
function l9#quickfix#compareEntries(e0, e1)
if a:e0.bufnr != a:e1.bufnr
let i0 = bufname(a:e0.bufnr)
let i1 = bufname(a:e1.bufnr)
elseif a:e0.lnum != a:e1.lnum
let i0 = a:e0.lnum
let i1 = a:e1.lnum
elseif a:e0.col != a:e1.col
let i0 = a:e0.col
let i1 = a:e1.col
else
return 0
endif
return (i0 > i1 ? +1 : -1)
endfunction
" Sorts quickfix
function l9#quickfix#sort()
call setqflist(sort(getqflist(), 'l9#quickfix#compareEntries'), 'r')
endfunction
" Highlights Quickfix lines by :sign.
" Inspired by errormarker plugin.
"
" You can customize the highlighting via L9ErrorLine and L9WarningLine
" highlight groups.
function l9#quickfix#placeSign()
let warnings = []
let errors = []
for e in filter(getqflist(), 'v:val.valid')
let warning = (e.type ==? 'w' || e.text =~? '^\s*warning:')
call add((warning ? warnings : errors), [e.bufnr, e.lnum])
endfor
sign unplace *
call l9#placeSign('L9WarningLine', '>>', '', warnings)
call l9#placeSign('L9ErrorLine', '>>', '', errors)
endfunction
highlight default L9ErrorLine ctermfg=white ctermbg=52 guibg=#5F0000
highlight default L9WarningLine ctermfg=white ctermbg=17 guibg=#00005F
" }}}1
"=============================================================================
" vim: set fdm=marker:

View file

@ -1,112 +0,0 @@
"=============================================================================
" Copyright (C) 2009-2010 Takeshi NISHIDA
"
"=============================================================================
" LOAD GUARD {{{1
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
finish
endif
" }}}1
"=============================================================================
" TEMPORARY BUFFER {{{1
" each key is a buffer name.
let s:dataMap = {}
"
function s:onBufDelete(bufname)
if exists('s:dataMap[a:bufname].listener.onClose')
call s:dataMap[a:bufname].listener.onClose(s:dataMap[a:bufname].written)
endif
if bufnr('%') == s:dataMap[a:bufname].bufNr && winnr('#') != 0
" if winnr('#') returns 0, "wincmd p" causes ringing the bell.
wincmd p
endif
endfunction
"
function s:onBufWriteCmd(bufname)
if !exists('s:dataMap[a:bufname].listener.onWrite') ||
\ s:dataMap[a:bufname].listener.onWrite(getline(1, '$'))
setlocal nomodified
let s:dataMap[a:bufname].written = 1
call l9#tempbuffer#close(a:bufname)
else
endif
endfunction
" a:bufname:
" a:height: Window height. If 0, default height is used.
" If less than 0, the window becomes full-screen.
" a:listener:
" a:listener.onClose(written)
function l9#tempbuffer#openScratch(bufname, filetype, lines, topleft, vertical, height, listener)
let openCmdPrefix = (a:topleft ? 'topleft ' : '')
\ . (a:vertical ? 'vertical ' : '')
\ . (a:height > 0 ? a:height : '')
if !exists('s:dataMap[a:bufname]') || !bufexists(s:dataMap[a:bufname].bufNr)
execute openCmdPrefix . 'new'
else
call l9#tempbuffer#close(a:bufname)
execute openCmdPrefix . 'split'
execute 'silent ' . s:dataMap[a:bufname].bufNr . 'buffer'
endif
if a:height < 0
only
endif
setlocal buflisted noswapfile bufhidden=delete modifiable noreadonly buftype=nofile
let &l:filetype = a:filetype
silent file `=a:bufname`
call setline(1, a:lines)
setlocal nomodified
augroup L9TempBuffer
autocmd! * <buffer>
execute printf('autocmd BufDelete <buffer> call s:onBufDelete (%s)', string(a:bufname))
execute printf('autocmd BufWriteCmd <buffer> nested call s:onBufWriteCmd(%s)', string(a:bufname))
augroup END
let s:dataMap[a:bufname] = {
\ 'bufNr': bufnr('%'),
\ 'written': 0,
\ 'listener': a:listener,
\ }
endfunction
"
function l9#tempbuffer#openReadOnly(bufname, filetype, lines, topleft, vertical, height, listener)
call l9#tempbuffer#openScratch(a:bufname, a:filetype, a:lines, a:topleft, a:vertical, a:height, a:listener)
setlocal nomodifiable readonly
endfunction
" a:listener:
" a:listener.onClose(written)
" a:listener.onWrite(lines)
function l9#tempbuffer#openWritable(bufname, filetype, lines, topleft, vertical, height, listener)
call l9#tempbuffer#openScratch(a:bufname, a:filetype, a:lines, a:topleft, a:vertical, a:height, a:listener)
setlocal buftype=acwrite
endfunction
" makes specified temp buffer current.
function l9#tempbuffer#moveTo(bufname)
return l9#moveToBufferWindowInCurrentTabpage(s:dataMap[a:bufname].bufNr) ||
\ l9#moveToBufferWindowInOtherTabpage(s:dataMap[a:bufname].bufNr)
endfunction
"
function l9#tempbuffer#close(bufname)
if !l9#tempbuffer#isOpen(a:bufname)
return
endif
execute printf('%dbdelete!', s:dataMap[a:bufname].bufNr)
endfunction
"
function l9#tempbuffer#isOpen(bufname)
return exists('s:dataMap[a:bufname]') && bufloaded(s:dataMap[a:bufname].bufNr)
endfunction
" }}}1
"=============================================================================
" vim: set fdm=marker:

View file

@ -1,60 +0,0 @@
"=============================================================================
" Copyright (C) 2010 Takeshi NISHIDA
"
"=============================================================================
" LOAD GUARD {{{1
if !l9#guardScriptLoading(expand('<sfile>:p'), 0, 0, [])
finish
endif
" }}}1
"=============================================================================
" TEMPORARY VARIABLES {{{1
"
let s:origMap = {}
" set temporary variables
function l9#tempvariables#set(group, name, value)
if !exists('s:origMap[a:group]')
let s:origMap[a:group] = {}
endif
if !exists('s:origMap[a:group][a:name]')
let s:origMap[a:group][a:name] = eval(a:name)
endif
execute 'let ' . a:name . ' = a:value'
endfunction
" set temporary variables
function l9#tempvariables#setList(group, variables)
for [name, value] in a:variables
call l9#tempvariables#set(a:group, name, value)
unlet value " to avoid E706
endfor
endfunction
" get temporary variables
function l9#tempvariables#getList(group)
if !exists('s:origMap[a:group]')
return []
endif
return map(keys(s:origMap[a:group]), '[v:val, eval(v:val)]')
endfunction
" restore original variables and clean up.
function l9#tempvariables#end(group)
if !exists('s:origMap[a:group]')
return
endif
for [name, value] in items(s:origMap[a:group])
execute 'let ' . name . ' = value'
unlet value " to avoid E706
endfor
unlet s:origMap[a:group]
endfunction
" }}}1
"=============================================================================
" vim: set fdm=marker:

View file

@ -1,55 +0,0 @@
*l9.txt* Vimスクリプトライブラリ
Copyright (c) 2009-2010 Takeshi NISHIDA
l9 *l9*
概要 |l9-introduction|
インストール |l9-installation|
使い方 |l9-usage|
CHANGELOG |l9-changelog|
あばうと |l9-about|
==============================================================================
概要 *l9-introduction*
l9はVimスクリプトの関数やコマンドを提供するライブラリです。
==============================================================================
インストール *l9-installation*
ZIPファイルをランタイムディレクトリに展開します。
以下のようにファイルが配置されるはずです。
>
<your runtime directory>/plugin/l9.vim
<your runtime directory>/doc/l9.txt
...
<
もしランタイムディレクトリが多数のプラグインでごちゃごちゃになるのが嫌なら、各
プラグインを個別のディレクトリに配置し、そのディレクトリのパスを 'runtimepath'
に追加してください。アンインストールも楽になります。
その後、ヘルプを有効にするためにタグファイルを更新してください。詳しくは
|add-local-help|を参照してください。
==============================================================================
使い方 *l9-usage*
ソースコードを参照してください。
==============================================================================
あばうと *l9-about* *l9-contact* *l9-author*
作者: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
ライセンス: MIT Licence
URL: http://www.vim.org/scripts/script.php?script_id=3252
http://bitbucket.org/ns9tks/vim-l9/
バグや要望など ~
こちらへどうぞ: http://bitbucket.org/ns9tks/vim-l9/issues/
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View file

@ -1,73 +0,0 @@
*l9.txt* Vim-script library
Copyright (c) 2009-2010 Takeshi NISHIDA
l9 *l9*
INTRODUCTION |l9-introduction|
INSTALLATION |l9-installation|
USAGE |l9-usage|
CHANGELOG |l9-changelog|
ABOUT |l9-about|
==============================================================================
INTRODUCTION *l9-introduction*
l9 is a Vim-script library, which provides some utility functions and commands
for programming in Vim.
==============================================================================
INSTALLATION *l9-installation*
Put all files into your runtime directory. If you have the zip file, extract
it to your runtime directory.
You should place the files as follows:
>
<your runtime directory>/plugin/l9.vim
<your runtime directory>/doc/l9.txt
...
<
If you are disgusted to make your runtime directory confused with a lot of
plugins, put each of the plugins into a directory individually and just add
the directory path to 'runtimepath'. It's easy to uninstall plugins.
Then update your help tags files to enable help for this plugin. See
|add-local-help| for details.
==============================================================================
USAGE *l9-usage*
See source code.
==============================================================================
CHANGELOG *l9-changelog*
1.1:
- Added l9#zip()
- Added l9#tempvariables#getList()
- Changed l9#guardScriptLoading()
- Removed l9#tempvariables#swap()
1.0.1:
- Fixed a bug that floating point numbers weren't evaluated correctly and
caused errors on some non-English locales.
1.0:
- First release.
==============================================================================
ABOUT *l9-about* *l9-contact* *l9-author*
Author: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
Licence: MIT Licence
URL: http://www.vim.org/scripts/script.php?script_id=3252
http://bitbucket.org/ns9tks/vim-l9/
Bugs/Issues/Suggestions/Improvements ~
Please submit to http://bitbucket.org/ns9tks/vim-l9/issues/ .
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View file

@ -1,108 +0,0 @@
"=============================================================================
" Copyright (C) 2009-2010 Takeshi NISHIDA
"
" GetLatestVimScripts: 3252 1 :AutoInstall: L9
"=============================================================================
" LOAD GUARD {{{1
if !l9#guardScriptLoading(expand('<sfile>:p'), 702, 0, [])
finish
endif
" }}}1
"=============================================================================
" OPTIONS: {{{1
call l9#defineVariableDefault('g:l9_balloonly', 'balloonly.exe')
" }}}1
"=============================================================================
" ASSERTION: {{{1
" This command has effect only if $L9_DEBUG is non-zero.
" Used as follows:
" L9Assert a:i > 0
" This command can't interpret script-local variables directly.
" NG: L9Assert s:a == 1
" OK: execute 'L9Assert ' . s:a . ' == 1'
"
if $L9_DEBUG
command -nargs=* L9Assert call eval((<args>) ? 0 : s:handleFailedAssersion(<q-args>))
function s:handleFailedAssersion(expr)
echoerr '[L9Assert] Assersion failure: ' . a:expr
if input('[L9Assert] Continue? (Y/N) ', 'Y') !=? 'Y'
throw 'L9Assert ' . a:expr
endif
endfunction
else
command -nargs=* L9Assert :
endif
" }}}1
"=============================================================================
" TIMER: {{{1
" These commands have effect only if $L9_TIMER is non-zero.
" Used as follows:
" L9Timer foo
" ... (1)
" L9Timer bar
" ... (2)
" L9TimerStop
" ...
" L9TimerDump <- shows each elapsed time of (1) and (2)
"
if $L9_TIMER
command -nargs=1 L9Timer call s:timerBegin(<q-args>)
command -nargs=0 L9TimerStop call s:timerStop()
command -nargs=0 L9TimerDump call s:timerDump()
let s:timerData = []
let s:timerTagMaxLen = 0
function s:timerBegin(tag)
L9TimerStop
let s:timerCurrent = {'tag': strftime('%c ') . a:tag . ' ', 'time': reltime()}
let s:timerTagMaxLen = max([len(s:timerCurrent.tag), s:timerTagMaxLen])
endfunction
function s:timerStop()
if !exists('s:timerCurrent')
return
endif
let s:timerCurrent.time = reltimestr(reltime(s:timerCurrent.time))
call add(s:timerData, s:timerCurrent)
unlet s:timerCurrent
endfunction
function s:timerDump()
L9TimerStop
let lines = map(s:timerData, 'v:val.tag . repeat(" ", s:timerTagMaxLen - len(v:val.tag)) . v:val.time')
call l9#tempbuffer#openReadOnly('[l9-timer]', '', lines, 0, 0, 0, {})
let s:timerData = []
let s:timerTagMaxLen = 0
endfunction
else
command -nargs=1 L9Timer :
command -nargs=0 L9TimerStop :
command -nargs=0 L9TimerDump :
endif
" }}}1
"=============================================================================
" GREP BUFFER: {{{1
" Grep for current buffer by l9#grepBuffers()
" Used as :L9GrepBuffer/pattern
command -nargs=? L9GrepBuffer call l9#grepBuffers(<q-args>, [bufnr('%')])
" Grep for all buffers by l9#grepBuffers()
" Used as :L9GrepBufferAll/pattern
command -nargs=? L9GrepBufferAll call l9#grepBuffers(<q-args>, range(1, bufnr('$')))
" }}}1
"=============================================================================
" vim: set fdm=marker: