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

Modify loclist to separate errors from warnings#798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
bixycler wants to merge1 commit intopython-mode:developfrombixycler:develop
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionautoload/pymode/lint.vim
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,7 +68,7 @@ fun! pymode#lint#check() "{{{
call loclist.show()

call pymode#lint#show_errormessage()
call pymode#wide_message('Founderrors and warnings: ' . len(loclist._loclist))
call pymode#wide_message('Found' . loclist.num_errors() . ' error(s) and ' .loclist.num_warnings() . ' warning(s)')

endfunction " }}}

Expand Down
32 changes: 26 additions & 6 deletionsautoload/pymode/tools/loclist.vim
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,19 +24,37 @@ endfunction "}}}


fun! g:PymodeLocList.is_empty() "{{{
return empty(self._loclist)
return empty(self._errlist) && empty(self._warnlist)
endfunction "}}}

fun! g:PymodeLocList.loclist() "{{{
let loclist = copy(self._errlist)
call extend(loclist, self._warnlist)
return loclist
endfunction "}}}

fun! g:PymodeLocList.num_errors() "{{{
return len(self._errlist)
endfunction "}}}

fun! g:PymodeLocList.num_warnings() "{{{
return len(self._warnlist)
endfunction "}}}


fun! g:PymodeLocList.clear() "{{{
let self._loclist = []
let self._errlist = []
let self._warnlist = []
let self._messages = {}
let self._name = expand('%:t')
endfunction "}}}


fun! g:PymodeLocList.extend(raw_list) "{{{
call extend(self._loclist, a:raw_list)
let err_list = filter(copy(a:raw_list), 'v:val["type"] == "E"')
let warn_list = filter(copy(a:raw_list), 'v:val["type"] != "E"')
call extend(self._errlist, err_list)
call extend(self._warnlist, warn_list)
for issue in a:raw_list
let self._messages[issue.lnum] = issue.text
endfor
Expand All@@ -46,7 +64,7 @@ endfunction "}}}

fun! g:PymodeLocList.filter(filters) "{{{
let loclist = []
for error in self._loclist
for error in self.loclist()
let passes_filters = 1
for key in keys(a:filters)
if get(error, key, '') !=? a:filters[key]
Expand All@@ -65,8 +83,9 @@ endfunction "}}}


fun! g:PymodeLocList.show() "{{{
call setloclist(0, self._loclist)
if self.is_empty()
call setloclist(0, self.loclist())
"if self.is_empty()
if self.num_errors() == 0
lclose
elseif g:pymode_lint_cwindow
let num = winnr()
Expand All@@ -77,5 +96,6 @@ fun! g:PymodeLocList.show() "{{{
call setwinvar(winnr(), 'quickfix_title', self._title . ' <' . self._name . '>')
exe num . "wincmd w"
endif
lfirst
end
endfunction "}}}
2 changes: 1 addition & 1 deletionautoload/pymode/tools/signs.vim
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ endfunction "}}}

fun! g:PymodeSigns.place(loclist) "{{{
let seen = {}
for issue in a:loclist._loclist
for issue in a:loclist.loclist()
if !has_key(seen, issue.lnum)
let seen[issue.lnum] = 1
call add(self._sign_ids, self._next_id)
Expand Down
2 changes: 1 addition & 1 deletionpymode/rope.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -184,7 +184,7 @@ def find_it():
text=env.lines[oc.lineno - 1] if oc.resource.real_path == env.curbuf.name else "", # noqa
lnum=oc.lineno,
))
env.let('loclist._loclist', lst)
env.run('g:PymodeLocList.current().extend', lst)


def update_python_path(paths):
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp