update vim-plug and update css-color loading
This commit is contained in:
@@ -611,7 +611,7 @@ function! s:prepare()
|
|||||||
silent %d _
|
silent %d _
|
||||||
else
|
else
|
||||||
call s:new_window()
|
call s:new_window()
|
||||||
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>echo<bar>q<cr>
|
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr>
|
||||||
nnoremap <silent> <buffer> R :silent! call <SID>retry()<cr>
|
nnoremap <silent> <buffer> R :silent! call <SID>retry()<cr>
|
||||||
nnoremap <silent> <buffer> D :PlugDiff<cr>
|
nnoremap <silent> <buffer> D :PlugDiff<cr>
|
||||||
nnoremap <silent> <buffer> S :PlugStatus<cr>
|
nnoremap <silent> <buffer> S :PlugStatus<cr>
|
||||||
@@ -1061,7 +1061,7 @@ endwhile
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:update_python()
|
function! s:update_python()
|
||||||
let py_exe = has('python3') ? 'python3' : 'python'
|
let py_exe = has('python') ? 'python' : 'python3'
|
||||||
execute py_exe "<< EOF"
|
execute py_exe "<< EOF"
|
||||||
""" Due to use of signals this function is POSIX only. """
|
""" Due to use of signals this function is POSIX only. """
|
||||||
import datetime
|
import datetime
|
||||||
@@ -1090,14 +1090,9 @@ G_CLONE_OPT = vim.eval('s:clone_opt')
|
|||||||
G_PROGRESS = vim.eval('s:progress_opt(1)')
|
G_PROGRESS = vim.eval('s:progress_opt(1)')
|
||||||
G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads'))
|
G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads'))
|
||||||
G_STOP = thr.Event()
|
G_STOP = thr.Event()
|
||||||
G_THREADS = {}
|
|
||||||
|
|
||||||
class PlugError(Exception):
|
class PlugError(Exception):
|
||||||
def __init__(self, msg):
|
pass
|
||||||
self._msg = msg
|
|
||||||
@property
|
|
||||||
def msg(self):
|
|
||||||
return self._msg
|
|
||||||
class CmdTimedOut(PlugError):
|
class CmdTimedOut(PlugError):
|
||||||
pass
|
pass
|
||||||
class CmdFailed(PlugError):
|
class CmdFailed(PlugError):
|
||||||
@@ -1288,7 +1283,7 @@ class Plugin(object):
|
|||||||
with self.lock:
|
with self.lock:
|
||||||
thread_vim_command("let s:update.new['{0}'] = 1".format(self.name))
|
thread_vim_command("let s:update.new['{0}'] = 1".format(self.name))
|
||||||
except PlugError as exc:
|
except PlugError as exc:
|
||||||
self.write(Action.ERROR, self.name, exc.msg)
|
self.write(Action.ERROR, self.name, [str(exc)])
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
G_STOP.set()
|
G_STOP.set()
|
||||||
self.write(Action.ERROR, self.name, ['Interrupted!'])
|
self.write(Action.ERROR, self.name, ['Interrupted!'])
|
||||||
@@ -1371,10 +1366,6 @@ class PlugThread(thr.Thread):
|
|||||||
work_q.task_done()
|
work_q.task_done()
|
||||||
except queue.Empty:
|
except queue.Empty:
|
||||||
pass
|
pass
|
||||||
finally:
|
|
||||||
global G_THREADS
|
|
||||||
with lock:
|
|
||||||
del G_THREADS[thr.current_thread().name]
|
|
||||||
|
|
||||||
class RefreshThread(thr.Thread):
|
class RefreshThread(thr.Thread):
|
||||||
def __init__(self, lock):
|
def __init__(self, lock):
|
||||||
@@ -1428,17 +1419,16 @@ def main():
|
|||||||
for work in plugs.items():
|
for work in plugs.items():
|
||||||
work_q.put(work)
|
work_q.put(work)
|
||||||
|
|
||||||
global G_THREADS
|
start_cnt = thr.active_count()
|
||||||
for num in range(nthreads):
|
for num in range(nthreads):
|
||||||
tname = 'PlugT-{0:02}'.format(num)
|
tname = 'PlugT-{0:02}'.format(num)
|
||||||
thread = PlugThread(tname, (buf_q, work_q, lock))
|
thread = PlugThread(tname, (buf_q, work_q, lock))
|
||||||
thread.start()
|
thread.start()
|
||||||
G_THREADS[tname] = thread
|
|
||||||
if mac_gui:
|
if mac_gui:
|
||||||
rthread = RefreshThread(lock)
|
rthread = RefreshThread(lock)
|
||||||
rthread.start()
|
rthread.start()
|
||||||
|
|
||||||
while not buf_q.empty() or len(G_THREADS) != 0:
|
while not buf_q.empty() or thr.active_count() != start_cnt:
|
||||||
try:
|
try:
|
||||||
action, name, msg = buf_q.get(True, 0.25)
|
action, name, msg = buf_q.get(True, 0.25)
|
||||||
buf.write(action, name, msg)
|
buf.write(action, name, msg)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Plug 'digitaltoad/vim-jade', { 'for': 'jade' }
|
|||||||
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }
|
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }
|
||||||
Plug 'wavded/vim-stylus', { 'for': ['stylus', 'markdown'] }
|
Plug 'wavded/vim-stylus', { 'for': ['stylus', 'markdown'] }
|
||||||
Plug 'groenewege/vim-less', { 'for': 'less' }
|
Plug 'groenewege/vim-less', { 'for': 'less' }
|
||||||
Plug 'ap/vim-css-color', { 'for': 'css' }
|
Plug 'ap/vim-css-color', { 'for': ['css','stylus','scss'] }
|
||||||
Plug 'hail2u/vim-css3-syntax', { 'for': 'css' }
|
Plug 'hail2u/vim-css3-syntax', { 'for': 'css' }
|
||||||
Plug 'itspriddle/vim-marked', { 'for': 'markdown', 'on': 'MarkedOpen' }
|
Plug 'itspriddle/vim-marked', { 'for': 'markdown', 'on': 'MarkedOpen' }
|
||||||
Plug 'tpope/vim-markdown', { 'for': 'markdown' }
|
Plug 'tpope/vim-markdown', { 'for': 'markdown' }
|
||||||
|
|||||||
Reference in New Issue
Block a user