Skip to content

Commit 90fb341

Browse files
committed
gitgutter compatibility
1 parent 8b36175 commit 90fb341

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

autoload/pymode.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,19 @@ fun! pymode#QuickfixOpen(onlyRecognized, holdCursor, maxHeight, minHeight, jumpE
5050
endfunction "}}}
5151

5252

53-
fun! pymode#PlaceSigns() "{{{
53+
fun! pymode#PlaceSigns(bnum) "{{{
5454
" DESC: Place error signs
5555
"
5656
if has('signs')
57-
sign unplace *
57+
" TODO: Create pymode sign namespace
58+
execute "sign unplace buffer=".a:bnum
5859

5960
if !pymode#Default("g:pymode_lint_signs_always_visible", 0) || g:pymode_lint_signs_always_visible
6061
call RopeShowSignsRulerIfNeeded()
6162
endif
6263

6364
for item in filter(getqflist(), 'v:val.bufnr != ""')
64-
execute printf('silent! sign place 1 line=%d name=%s buffer=%d', item.lnum, item.type, item.bufnr)
65+
execute printf('sign place %d line=%d name=%s buffer=%d', item.lnum, item.lnum, "Pymode".item.type, item.bufnr)
6566
endfor
6667

6768
endif

autoload/pymode/lint.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ fun! pymode#lint#Check() "{{{
2020
endfunction " }}}
2121

2222

23-
fun! pymode#lint#Parse()
23+
fun! pymode#lint#Parse(bnum)
2424
" DESC: Parse result of code checking.
2525
"
2626
call setqflist(g:qf_list, 'r')
2727

2828
if g:pymode_lint_signs
29-
call pymode#PlaceSigns()
29+
call pymode#PlaceSigns(a:bnum)
3030
endif
3131

3232
if g:pymode_lint_cwindow

ftplugin/python/init-pymode.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
111111
if (!pymode#Default("g:pymode_lint_signs", 1) || g:pymode_lint_signs) && has('signs')
112112

113113
" DESC: Signs definition
114-
sign define W text=WW texthl=Todo
115-
sign define C text=CC texthl=Comment
116-
sign define R text=RR texthl=Visual
117-
sign define E text=EE texthl=Error
118-
sign define I text=II texthl=Info
114+
sign define PymodeW text=WW texthl=Todo
115+
sign define PymodeC text=CC texthl=Comment
116+
sign define PymodeR text=RR texthl=Visual
117+
sign define PymodeE text=EE texthl=Error
118+
sign define PymodeI text=II texthl=Info
119+
sign define PymodeF text=FF texthl=Info
119120

120121
if !pymode#Default("g:pymode_lint_signs_always_visible", 0) || g:pymode_lint_signs_always_visible
121122
" Show the sign's ruller if asked for, even it there's no error to show

pylibs/pylama/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def run(path, ignore=None, select=None, linters=default_linters, **meta): # nol
4545
for e in linter(path, code=code, **meta):
4646
e['col'] = e.get('col') or 0
4747
e['lnum'] = e.get('lnum') or 0
48-
e['type'] = e.get('type') or 'E'
48+
e['type'] = e.get('type') or 'W'
4949
e['text'] = "{0} [{1}]".format((e.get(
5050
'text') or '').strip()
5151
.replace("'", "\"").split('\n')[0], lint)

pylibs/pymode/lint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def run_checkers(task=None, checkers=None, ignore=None,
5757
task.done = 100
5858

5959

60-
def parse_result(result):
61-
command(('let g:qf_list = %s' % repr(result)).replace('\': u', '\': '))
62-
command('call pymode#lint#Parse()')
60+
def parse_result(result, bnum):
61+
command(('let g:qf_list = {0}'.format(repr(result)).replace('\': u', '\': ')))
62+
command('call pymode#lint#Parse({0})'.format(bnum))
6363

6464
# pymode:lint_ignore=W0622

pylibs/pymode/queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ def check_task():
5555
if isinstance(thread, Task):
5656
if thread.finished:
5757
thread.stop()
58-
thread.callback(thread.result)
58+
thread.callback(thread.result, thread.buffer.number)
5959
else:
6060
show_message('%s %s%%' % (thread.title, thread.done))

0 commit comments

Comments
 (0)