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

Commitd295a98

Browse files
committed
Merge branch 'release/0.7.2b'
2 parents26bba03 +e70721f commitd295a98

File tree

20 files changed

+352
-97
lines changed

20 files changed

+352
-97
lines changed

‎.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ language: ruby
22
python:"2.7"
33
rvm:
44
-1.9.3
5-
script:rake ci
5+
script:
6+
-make travis

‎Changelog.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Changelog
22
=========
33

4-
## 2013-12-01 0.7.1b
4+
## 2013-12-02 0.7.2b
55
--------------------
66
* Update indentation support;
77
* Python3 support;
@@ -21,18 +21,21 @@ Changelog
2121
'pymode_rope_enable_autoimport' -> 'pymode_rope_autoimport'
2222

2323
* Options removed:
24+
2425
'pymode_lint_hold', 'pymode_lint_config', 'pymode_lint_jump',
2526
'pymode_lint_signs_always_visible', 'pymode_rope_extended_complete',
2627
'pymode_rope_auto_project', 'pymode_rope_autoimport_generate',
2728
'pymode_rope_autoimport_underlines', 'pymode_rope_codeassist_maxfixes',
2829
'pymode_rope_sorted_completions', 'pymode_rope_extended_complete',
2930
'pymode_rope_confirm_saving', 'pymode_rope_global_prefix',
30-
'pymode_rope_local_prefix', 'pymode_rope_vim_completion', 'pymode_rope_guess_project',
31-
'pymode_rope_goto_def_newwin', 'pymode_rope_always_show_complete_menu'
31+
'pymode_rope_local_prefix', 'pymode_rope_vim_completion',
32+
'pymode_rope_guess_project', 'pymode_rope_goto_def_newwin',
33+
'pymode_rope_always_show_complete_menu'
3234

3335
* Options added:
34-
'pymode_rope_regenerate_on_write', 'pymode_rope_completion', 'pymode_rope_complete_on_dot',
35-
'pymode_lint_sort'
36+
'pymode_rope_regenerate_on_write', 'pymode_rope_completion',
37+
'pymode_rope_complete_on_dot', 'pymode_lint_sort',
38+
'pymode_rope_look_project', 'pymode_lint_unmodified'
3639

3740
* Commands added:
3841
'PymodeVirtualenv'

‎Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ PYLAMA = $(LIBS)/pylama
66
clean:
77
find. -name"*.pyc" -delete
88

9+
# Temporary disable rope tests on Travis
10+
.PHONY: travis
11+
travis:
12+
rm -rf t/rope.vim
13+
raketest
14+
915
.PHONY: test
1016
test:
1117
bundle install
18+
rm -rf$(CURDIR)/.ropeproject
1219
raketest
1320

1421
.PHONY: pylama

‎README.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,16 @@ Then rebuild **helptags** in vim::
9898
Troubleshooting
9999
===============
100100

101-
If your python-mode doesn't work: open any python file and type: ::
101+
If your python-mode doesn't work:
102102

103-
:call pymode#troubleshooting#test()
103+
1. Load Vim with only python-mode enabled (use `debug.vim` from pymode): ::
104+
105+
vim -u <path_to_pymode>/debug.vim
106+
107+
And try to repeat your case. If no error occurs, seems like problem isnt in the
108+
plugin.
109+
110+
2. Type `:PymodeTroubleshooting`
104111

105112
And fix any warnings or copy the output and send it to me. (For example, by
106113
creating a `new github issue<https://github.com/klen/python-mode/issues/new>`_

‎autoload/pymode.vim

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ fun! pymode#save() "{{{
8686
try
8787
noautocmdwrite
8888
catch/E212/
89-
callpymode#error("File modified and I can't save it.Cancel code checking.")
89+
callpymode#error("File modified and I can't save it.Please save it manually.")
9090
return0
9191
endtry
9292
endif
93-
return1
93+
returnexpand('%')!=''
9494
endfunction"}}}
9595

9696
fun!pymode#reload_buf_by_nr(nr)"{{{
@@ -110,9 +110,18 @@ endfunction
110110

111111
fun!pymode#buffer_post_write()"{{{
112112
ifb:pymode_modified&&g:pymode_rope_regenerate_on_write
113+
callpymode#debug('regenerate')
113114
callpymode#rope#regenerate()
114115
endif
115-
ifb:pymode_modified&&g:pymode_lint_on_write
116+
ifg:pymode_lint_unmodified|| (g:pymode_lint_on_write&&b:pymode_modified)
117+
callpymode#debug('check code')
116118
callpymode#lint#check()
117119
endif
118120
endfunction"}}}
121+
122+
fun!pymode#debug(msg)"{{{
123+
ifg:pymode_debug
124+
letg:pymode_debug+=1
125+
echomstring(g:pymode_debug) .':' .string(a:msg)
126+
endif
127+
endfunction"}}}

‎autoload/pymode/lint.vim

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
PymodePython from pymode.lintimport code_check
22

3+
callpymode#tools#signs#init()
4+
callpymode#tools#loclist#init()
5+
6+
37
fun!pymode#lint#auto()"{{{
48
if!pymode#save()
59
return0
@@ -13,7 +17,8 @@ endfunction "}}}
1317

1418

1519
fun!pymode#lint#show_errormessage()"{{{
16-
ifempty(b:pymode_errors)
20+
let loclist=g:PymodeLocList.current()
21+
if loclist.is_empty()
1722
return
1823
endif
1924

@@ -22,8 +27,8 @@ fun! pymode#lint#show_errormessage() "{{{
2227
return
2328
endif
2429
letb:pymode_error_line=l
25-
ifhas_key(b:pymode_errors,l)
26-
callpymode#wide_message(b:pymode_errors[l])
30+
ifhas_key(loclist._messages,l)
31+
callpymode#wide_message(loclist._messages[l])
2732
else
2833
echo
2934
endif
@@ -39,47 +44,37 @@ fun! pymode#lint#toggle() "{{{
3944
end
4045
endfunction"}}}
4146

47+
4248
fun!pymode#lint#check()"{{{
4349
" DESC: Run checkers on current file.
4450
"
45-
if!g:pymode_lint |return |endif
51+
let loclist=g:PymodeLocList.current()
52+
53+
letb:pymode_error_line=-1
4654

47-
letb:pymode_errors= {}
55+
call loclist.clear()
4856

4957
callpymode#wide_message('Code checking is running ...')
5058

5159
PymodePythoncode_check()
5260

53-
let errors=getqflist()
54-
ifempty(errors)
61+
if loclist.is_empty()
5562
callpymode#wide_message('Code checking is completed. No errors found.')
5663
endif
5764

65+
callg:PymodeSigns.refresh(loclist)
66+
5867
ifg:pymode_lint_cwindow
68+
callsetqflist(loclist._loclist)
5969
callpymode#quickfix_open(0,g:pymode_quickfix_maxheight,g:pymode_quickfix_minheight,0)
6070
endif
6171

62-
ifg:pymode_lint_signs
63-
for iteminb:pymode_signs
64-
executeprintf('sign unplace %d buffer=%d', item.lnum, item.bufnr)
65-
endfor
66-
letb:pymode_lint_signs= []
67-
for iteminfilter(errors,'v:val.bufnr != ""')
68-
calladd(b:pymode_signs, item)
69-
executeprintf('sign place %d line=%d name=%s buffer=%d', item.lnum, item.lnum,"Pymode".item.type, item.bufnr)
70-
endfor
71-
endif
72-
73-
for itemin errors
74-
letb:pymode_errors[item.lnum]= item.text
75-
endfor
76-
77-
letb:pymode_error_line=-1
7872
callpymode#lint#show_errormessage()
79-
callpymode#wide_message('Found errors and warnings:' .len(errors))
73+
callpymode#wide_message('Found errors and warnings:' .len(loclist._loclist))
8074

8175
endfunction" }}}
8276

77+
8378
fun!pymode#lint#tick_queue()"{{{
8479

8580
pythonimport time
@@ -96,11 +91,13 @@ fun! pymode#lint#tick_queue() "{{{
9691
endif
9792
endfunction"}}}
9893

94+
9995
fun!pymode#lint#stop()"{{{
10096
au! pymodeCursorHold<buffer>
101-
endfunction
97+
endfunction"}}}
98+
10299

103100
fun!pymode#lint#start()"{{{
104101
au! pymodeCursorHold<buffer>callpymode#lint#tick_queue()
105102
callpymode#lint#tick_queue()
106-
endfunction
103+
endfunction"}}}

‎autoload/pymode/rope.vim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ fun! pymode#rope#module_to_package() "{{{
161161
endfunction"}}}
162162

163163
fun!pymode#rope#autoimport(word)"{{{
164-
if!pymode#save()
165-
return0
166-
endif
167164
PymodePython rope.autoimport()
168165
endfunction"}}}
169166

‎autoload/pymode/tools/loclist.vim

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
letg:PymodeLocList= {}
2+
3+
4+
fun!pymode#tools#loclist#init()"{{{
5+
return
6+
endfunction"}}}
7+
8+
9+
fun!g:PymodeLocList.init(raw_list)"{{{
10+
let obj=copy(self)
11+
let loc_list=filter(copy(a:raw_list),'v:val["valid"] == 1')
12+
call obj.clear()
13+
return obj
14+
endfunction"}}}
15+
16+
17+
fun!g:PymodeLocList.current()"{{{
18+
if!exists("b:pymode_loclist")
19+
letb:pymode_loclist=g:PymodeLocList.init([])
20+
endif
21+
letb:pymode_loclist._bufnr=bufnr('.')
22+
returnb:pymode_loclist
23+
endfunction"}}}
24+
25+
26+
fun!g:PymodeLocList.is_empty()"{{{
27+
returnempty(self._loclist)
28+
endfunction"}}}
29+
30+
31+
fun!g:PymodeLocList.clear()"{{{
32+
letself._loclist= []
33+
letself._messages= {}
34+
letself._bufnr=bufnr('')
35+
endfunction"}}}
36+
37+
38+
fun!g:PymodeLocList.extend(raw_list)"{{{
39+
callextend(self._loclist,a:raw_list)
40+
for issueina:raw_list
41+
letself._messages[issue.lnum]= issue.text
42+
endfor
43+
returnself
44+
endfunction"}}}
45+
46+
47+
fun!g:PymodeLocList.filter(filters)"{{{
48+
let loclist= []
49+
forerrorinself._loclist
50+
let passes_filters=1
51+
forkeyinkeys(a:filters)
52+
ifget(error,key,'')!=?a:filters[key]
53+
let passes_filters=0
54+
break
55+
endif
56+
endfor
57+
58+
if passes_filters
59+
calladd(loclist,error)
60+
endif
61+
62+
endfor
63+
return loclist
64+
endfunction"}}}

‎autoload/pymode/tools/signs.vim

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
letg:PymodeSigns= {}
2+
3+
4+
fun!pymode#tools#signs#init()"{{{
5+
callg:PymodeSigns.setup()
6+
endfunction"}}}
7+
8+
9+
fun!g:PymodeSigns.enabled()"{{{
10+
return (g:pymode_lint_signs&&has('signs'))
11+
endfunction"}}}
12+
13+
14+
fun!g:PymodeSigns.setup()"{{{
15+
ifself.enabled()
16+
execute'sign define PymodeW text=' .g:pymode_lint_todo_symbol ." texthl=Todo"
17+
execute'sign define PymodeC text=' .g:pymode_lint_comment_symbol ." texthl=Comment"
18+
execute'sign define PymodeR text=' .g:pymode_lint_visual_symbol ." texthl=Visual"
19+
execute'sign define PymodeE text=' .g:pymode_lint_error_symbol ." texthl=Error"
20+
execute'sign define PymodeI text=' .g:pymode_lint_info_symbol ." texthl=Info"
21+
execute'sign define PymodeF text=' .g:pymode_lint_pyflakes_symbol ." texthl=Info"
22+
endif
23+
letself._sign_ids= []
24+
letself._next_id=10000
25+
letself._messages= {}
26+
endfunction"}}}
27+
28+
29+
fun!g:PymodeSigns.refresh(loclist)"{{{
30+
ifself.enabled()
31+
callself.clear()
32+
callself.place(a:loclist)
33+
endif
34+
endfunction"}}}
35+
36+
37+
fun!g:PymodeSigns.clear()"{{{
38+
let ids=copy(self._sign_ids)
39+
foriin ids
40+
execute"sign unplace" .i
41+
callremove(self._sign_ids,index(self._sign_ids,i))
42+
endfor
43+
endfunction"}}}
44+
45+
46+
fun!g:PymodeSigns.place(loclist)"{{{
47+
let seen= {}
48+
for issueina:loclist._loclist
49+
if!has_key(seen, issue.lnum)
50+
let seen[issue.lnum]=1
51+
calladd(self._sign_ids,self._next_id)
52+
executeprintf('sign place %d line=%d name=%s buffer=%d',self._next_id, issue.lnum,"Pymode".issue.type[0], issue.bufnr)
53+
letself._next_id+=1
54+
endif
55+
endfor
56+
endfunction"}}}

‎debug.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
" Use this settings for testing the plugin.
2+
" Run vim with command
3+
"
4+
" $ vim -u debug.py
5+
"
6+
" Only python-mode will be loaded.
7+
8+
9+
execute('set rtp+='.expand('<sfile>:p:h'))
10+
setrtp-=$HOME/.vim
11+
setrtp-=$HOME/.vim/after
12+
setnocp
13+
syntaxenable

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp