Skip to content

Commit bc5dc3d

Browse files
committed
Fix checking
1 parent 8d5c556 commit bc5dc3d

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

autoload/pymode/lint.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ fun! pymode#lint#Check() "{{{
1515
let g:pymode_lint_buffer = bufnr('%')
1616

1717
py from pymode import lint
18-
py queue.stop_queue(False)
1918
py lint.check_file()
2019

2120
endfunction " }}}

autoload/pymode/queue.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ fun! pymode#queue#Poll() "{{{
55

66
" Update interval
77
if mode() == 'i'
8-
let p = getpos('.')
9-
silent exe 'call feedkeys("\<Up>\<Down>", "n")'
10-
call setpos('.', p)
8+
if col('.') == 1
9+
call feedkeys("\<Right>\<Left>", "n")
10+
else
11+
call feedkeys("\<Left>\<Right>", "n")
12+
endif
1113
else
1214
call feedkeys("f\e", "n")
1315
endif

pylibs/pymode/lint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import absolute_import
22

33
import locale
4+
import json
45

56
from pylama.main import run
67

@@ -56,8 +57,7 @@ def run_checkers(checkers=None, ignore=None, buf=None, select=None,
5657

5758

5859
def parse_result(result, buf=None, **kwargs):
59-
command(('let g:qf_list = {0}'.format(repr(result)).replace(
60-
'\': u', '\': ')))
60+
command('let g:qf_list = ' + json.dumps(result))
6161
command('call pymode#lint#Parse({0})'.format(buf.number))
6262

6363
# pymode:lint_ignore=W0622

pylibs/pymode/queue.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
MAX_LIFE = 60
1010
CHECK_INTERVAL = .2
1111
RESULTS = Queue()
12+
TEST = 1
1213

1314

1415
class Task(threading.Thread):
1516

1617
def __init__(self, *args, **kwargs):
17-
self.stop = threading.Event()
1818
threading.Thread.__init__(self, *args, **kwargs)
19+
self.stop = threading.Event()
1920

2021
def run(self):
2122
""" Run the task.
@@ -34,6 +35,11 @@ def run(self):
3435
def add_task(target, title=None, *args, **kwargs):
3536
" Add all tasks. "
3637

38+
# Only one task at time
39+
for thread in threading.enumerate():
40+
if isinstance(thread, Task):
41+
return True
42+
3743
task = Task(target=target, args=args, kwargs=kwargs)
3844
task.daemon = True
3945
task.start()

0 commit comments

Comments
 (0)