Hi Johannes and Bram,
I received a bug report from Masami Hirata.
runtime/ftplugin/python.vim has two problrems.
#1.
> if exists('*<SID>Python_jump') | finish | endif
Line 29 or later is script-local scope. But exists buffer-local
processing.
It's from line 43 to line 62.
How to reproduce.
1. New file "a.py" edit
vim a.py
2. Change insert-mode and input.
iif a:<CR>x<Esc>
3. I'll make sure before the x is 4 blanks. (from ftplugin/python.vim: 49)
4. New file "b.py" open new window.
:new b.py
5. Change insert-mode and input.
iif b:<CR>x<Esc>
6. I'll make sure before the x is 1 tab. (ftplugin/python.vim: 49 is not
reflected)
#2.
line 9,10 is save cpo and overwrite this. But When finish at line 29,
cpo does not return to the original.
I wrote a patch to solve above two problems.
Please check and include this.
Best regards,
Hirohito Higashi
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff -r 58bcf8fa172f runtime/ftplugin/python.vim
--- a/runtime/ftplugin/python.vim Sun Nov 17 20:32:54 2013 +0100
+++ b/runtime/ftplugin/python.vim Tue Nov 26 23:11:58 2013 +0900
@@ -26,25 +26,6 @@
nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr>
nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr>
-if exists('*<SID>Python_jump') | finish | endif
-
-fun! <SID>Python_jump(motion) range
- let cnt = v:count1
- let save = @/ " save last search pattern
- mark '
- while cnt > 0
- silent! exe a:motion
- let cnt = cnt - 1
- endwhile
- call histdel('/', -1)
- let @/ = save " restore last search pattern
-endfun
-
-if has("gui_win32") && !exists("b:browsefilter")
- let b:browsefilter = "Python Files (*.py)\t*.py\n" .
- \ "All Files (*.*)\t*.*\n"
-endif
-
" As suggested by PEP8.
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
@@ -61,5 +42,24 @@
setlocal keywordprg=pydoc
endif
+if has("gui_win32") && !exists("b:browsefilter")
+ let b:browsefilter = "Python Files (*.py)\t*.py\n" .
+ \ "All Files (*.*)\t*.*\n"
+endif
+
+if !exists('*<SID>Python_jump')
+ fun! <SID>Python_jump(motion) range
+ let cnt = v:count1
+ let save = @/ " save last search pattern
+ mark '
+ while cnt > 0
+ silent! exe a:motion
+ let cnt = cnt - 1
+ endwhile
+ call histdel('/', -1)
+ let @/ = save " restore last search pattern
+ endfun
+endif
+
let &cpo = s:keepcpo
unlet s:keepcpo