Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf8ddc7

Browse files
committed
Switch to loclist
1 parent3485b69 commitcf8ddc7

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

‎autoload/pymode.vim

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,17 @@ fun! pymode#buffer_pre_write() "{{{
110110
endfunction
111111

112112
fun!pymode#buffer_post_write()"{{{
113-
ifb:pymode_modified&&g:pymode_rope_regenerate_on_write
114-
callpymode#debug('regenerate')
115-
callpymode#rope#regenerate()
113+
ifg:pymode_rope
114+
ifb:pymode_modified&&g:pymode_rope_regenerate_on_write
115+
callpymode#debug('regenerate')
116+
callpymode#rope#regenerate()
117+
endif
116118
endif
117-
ifg:pymode_lint_unmodified|| (g:pymode_lint_on_write&&b:pymode_modified)
118-
callpymode#debug('check code')
119-
callpymode#lint#check()
119+
ifg:pymode_lint
120+
ifg:pymode_lint_unmodified|| (g:pymode_lint_on_write&&b:pymode_modified)
121+
callpymode#debug('check code')
122+
callpymode#lint#check()
123+
endif
120124
endif
121125
endfunction"}}}
122126

‎autoload/pymode/lint.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ fun! pymode#lint#check() "{{{
6565
callg:PymodeSigns.refresh(loclist)
6666

6767
ifg:pymode_lint_cwindow
68-
callsetqflist(loclist._loclist)
69-
callpymode#quickfix_open(0,g:pymode_quickfix_maxheight,g:pymode_quickfix_minheight,0)
68+
call loclist.show()
7069
endif
7170

7271
callpymode#lint#show_errormessage()

‎autoload/pymode/rope.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"
33
PymodePython from pymodeimport rope
44

5+
callpymode#tools#loclist#init()
6+
57

68
fun!pymode#rope#completions(findstart, base)
79
PymodePython rope.completions()
@@ -56,8 +58,10 @@ fun! pymode#rope#find_it()
5658
PymodePython rope.find_it()
5759
callpymode#wide_message('')
5860
if!empty(l:output)
59-
callsetqflist(l:output)
60-
callpymode#quickfix_open(0,g:pymode_quickfix_maxheight,g:pymode_quickfix_minheight,0)
61+
let loclist=g:PymodeLocList.current()
62+
let loclist._loclist=l:output
63+
let loclist._title="Occurrences"
64+
call loclist.show()
6165
end
6266
endfunction
6367

‎autoload/pymode/run.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ let s:efm .= '%-G%.%#'
4343

4444
PymodePython from pymode.runimport run_code
4545

46+
callpymode#tools#loclist#init()
47+
4648

4749
" DESC: Run python code
4850
fun!pymode#run#code_run(line1, line2)"{{{
@@ -86,7 +88,11 @@ fun! pymode#run#code_run(line1, line2) "{{{
8688
callsetqflist(qflist)
8789
endif
8890

89-
callpymode#quickfix_open(0,g:pymode_quickfix_maxheight,g:pymode_quickfix_maxheight,0)
91+
let loclist=g:PymodeLocList.current()
92+
let loclist._loclist=getqflist()
93+
let loclist._title="Run errors"
94+
call loclist.show()
95+
9096
let &efm=l:_efm
9197

9298
catch/E234/

‎autoload/pymode/tools/loclist.vim

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fun! g:PymodeLocList.init(raw_list) "{{{
1010
let obj=copy(self)
1111
let loc_list=filter(copy(a:raw_list),'v:val["valid"] == 1')
1212
call obj.clear()
13+
let obj._title='CodeCheck'
1314
return obj
1415
endfunction"}}}
1516

@@ -18,7 +19,6 @@ fun! g:PymodeLocList.current() "{{{
1819
if!exists("b:pymode_loclist")
1920
letb:pymode_loclist=g:PymodeLocList.init([])
2021
endif
21-
letb:pymode_loclist._bufnr=bufnr('.')
2222
returnb:pymode_loclist
2323
endfunction"}}}
2424

@@ -31,7 +31,7 @@ endfunction "}}}
3131
fun!g:PymodeLocList.clear()"{{{
3232
letself._loclist= []
3333
letself._messages= {}
34-
letself._bufnr=bufnr('')
34+
letself._name=expand('%:t')
3535
endfunction"}}}
3636

3737

@@ -62,3 +62,19 @@ fun! g:PymodeLocList.filter(filters) "{{{
6262
endfor
6363
return loclist
6464
endfunction"}}}
65+
66+
67+
fun!g:PymodeLocList.show()"{{{
68+
callsetloclist(0,self._loclist)
69+
ifself.is_empty()
70+
lclose
71+
else
72+
let num=winnr()
73+
execute"lopen" .g:pymode_quickfix_maxheight
74+
executemax([min([line("$"),g:pymode_quickfix_maxheight]),g:pymode_quickfix_minheight]) ."wincmd _"
75+
if num!=winnr()
76+
callsetwinvar(winnr(),'quickfix_title',self._title .' <' .self._name .'>')
77+
wincmdp
78+
endif
79+
end
80+
endfunction"}}}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp