@@ -4,25 +4,26 @@ function! pymode#lint#Check()
44 try
55 write
66 catch /E212/
7- echohl Error | echo " File modified and I can't save it. PyLint cancel ." | echohl None
7+ echohl Error | echo " File modified and I can't save it. Cancel code checking ." | echohl None
88 return 0
99 endtry
1010 endif
1111
1212 py check_file ()
1313
14- if len ( b : qf_list) || ( exists ( ' b:errors ' ) && len ( b: errors ))
14+ if g : qf_list != b: qf_list
1515
1616 call setqflist (b: qf_list , ' r' )
1717
18+ let g: qf_list = b: qf_list
19+
1820 if g: pymode_lint_cwindow
1921 call pymode#QuickfixOpen (0 , g: pymode_lint_hold , g: pymode_lint_maxheight , g: pymode_lint_minheight , g: pymode_lint_jump )
2022 endif
2123
2224 endif
2325
2426 if g: pymode_lint_message
25- let b: errors = {}
2627 for v in b: qf_list
2728 let b: errors [v [' lnum' ]] = v [' text' ]
2829 endfor
@@ -35,21 +36,25 @@ function! pymode#lint#Check()
3536
3637endfunction
3738
39+
3840fun ! pymode#lint#Toggle () " {{{
3941 let g: pymode_lint = g: pymode_lint ? 0 : 1
4042 call pymode#lint#toggle_win (g: pymode_lint , " Pymode lint" )
4143endfunction " }}}
4244
45+
4346fun ! pymode#lint#ToggleWindow () " {{{
4447 let g: pymode_lint_cwindow = g: pymode_lint_cwindow ? 0 : 1
4548 call pymode#lint#toggle_win (g: pymode_lint_cwindow , " Pymode lint cwindow" )
4649endfunction " }}}
4750
51+
4852fun ! pymode#lint#ToggleChecker () " {{{
4953 let g: pymode_lint_checker = g: pymode_lint_checker == " pylint" ? " pyflakes" : " pylint"
5054 echomsg " Pymode lint checker: " . g: pymode_lint_checker
5155endfunction " }}}
5256
57+
5358fun ! pymode#lint#toggle_win (toggle, msg) " {{{
5459 if a: toggle
5560 echomsg a: msg ." enabled"
@@ -63,11 +68,10 @@ fun! pymode#lint#toggle_win(toggle, msg) "{{{
6368 endif
6469endfunction " }}}
6570
71+
6672fun ! pymode#lint#show_errormessage () " {{{
73+ if ! len (b: errors ) | return | endif
6774 let cursor = getpos (" ." )
68- if ! pymode#Default (' b:errors' , {}) || ! len (b: errors )
69- return
70- endif
7175 if has_key (b: errors , l: cursor [1 ])
7276 call pymode#WideMessage (b: errors [l: cursor [1 ]])
7377 let b: show_message = 1
0 commit comments