Re: [patch][bugfix] ftplugin/python.vim

2013-11-28 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:

 Hi Christian,
 
 2013/11/27(Wed) 0:10:35 UTC+9 Christian Brabandt:
  I don't have anything to contribute except for this part of the patch:
  
  
  
   +if has(gui_win32)  !exists(b:browsefilter)
  
   +let b:browsefilter = Python Files (*.py)\t*.py\n .
  
   +\ All Files (*.*)\t*.*\n
  
   +endif
  
  
  
  BTW: b:browsefilter is also supported by the GTK Gui. You can check by
  
  :echo has(browsefilter)
 Oh! That's right. Thanks for your advice.
 I update a patch.

I think we do want to check if b:browsefilter already exists.  It means
that another plugin has already set it, thus we should leave it alone.

if has(browsefilter)  !exists(b:browsefilter)
let b:browsefilter = Python Files (*.py)\t*.py\n .
   \ All Files (*.*)\t*.*\n
endif

Any reason you move Python_jump() further down?  Not executing the
finish appears the fix needed.

-- 
login: yes
password: I don't know, please tell me
password is incorrect
login: yes
password: incorrect

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [patch][bugfix] ftplugin/python.vim

2013-11-28 Fir de Conversatie h_east
Hi Bram,

2013/11/28(Thu) 20:46:55 UTC+9 Bram Moolenaar:
 Hirohito Higashi wrote:
 
 
 
  Hi Christian,
 
  
 
  2013/11/27(Wed) 0:10:35 UTC+9 Christian Brabandt:
 
   I don't have anything to contribute except for this part of the patch:
 
   
 
   
 
   
 
+if has(gui_win32)  !exists(b:browsefilter)
 
   
 
+let b:browsefilter = Python Files (*.py)\t*.py\n .
 
   
 
+\ All Files (*.*)\t*.*\n
 
   
 
+endif
 
   
 
   
 
   
 
   BTW: b:browsefilter is also supported by the GTK Gui. You can check by
 
   
 
   :echo has(browsefilter)
 
  Oh! That's right. Thanks for your advice.
 
  I update a patch.
 
 
 
 I think we do want to check if b:browsefilter already exists.  It means
 
 that another plugin has already set it, thus we should leave it alone.
 
 
 
 if has(browsefilter)  !exists(b:browsefilter)
 
 let b:browsefilter = Python Files (*.py)\t*.py\n .
 
  \ All Files (*.*)\t*.*\n
 
 endif
 
 
 
 Any reason you move Python_jump() further down?  Not executing the
 
 finish appears the fix needed.

Thanks. I update patch simply.
Please check this again. 

Oh!! It is already fixed in rev.5510:d7d7bac1a163 :-)

Thank you Bram.

Best regards,
Hirohito Higashi

 
 
 
 -- 
 
 login: yes
 
 password: I don't know, please tell me
 
 password is incorrect
 
 login: yes
 
 password: incorrect
 
 
 
  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
 
 ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
 
 \\\  an exciting new programming language -- http://www.Zimbu.org///
 
  \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[patch][bugfix] ftplugin/python.vim

2013-11-26 Fir de Conversatie h_east
Hi Johannes and Bram,

I received a bug report from Masami Hirata.

runtime/ftplugin/python.vim has two problrems.

#1.
 if exists('*SIDPython_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:CRxEsc

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:CRxEsc

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 vim_dev+unsubscr...@googlegroups.com.
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 SIDPython_jump('/^\s*\(class\\|def\)')cr
 nnoremap silent buffer [m :call SIDPython_jump('?^\s*\(class\\|def\)')cr
 
-if exists('*SIDPython_jump') | finish | endif
-
-fun! SIDPython_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('*SIDPython_jump') 
+	fun! SIDPython_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


Re: [patch][bugfix] ftplugin/python.vim

2013-11-26 Fir de Conversatie Christian Brabandt
I don't have anything to contribute except for this part of the patch:

 +if has(gui_win32)  !exists(b:browsefilter)
 +let b:browsefilter = Python Files (*.py)\t*.py\n .
 +\ All Files (*.*)\t*.*\n
 +endif

BTW: b:browsefilter is also supported by the GTK Gui. You can check by
:echo has(browsefilter)

Best,
Christian

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [patch][bugfix] ftplugin/python.vim

2013-11-26 Fir de Conversatie h_east
Hi Christian,

2013/11/27(Wed) 0:10:35 UTC+9 Christian Brabandt:
 I don't have anything to contribute except for this part of the patch:
 
 
 
  +if has(gui_win32)  !exists(b:browsefilter)
 
  +let b:browsefilter = Python Files (*.py)\t*.py\n .
 
  +\ All Files (*.*)\t*.*\n
 
  +endif
 
 
 
 BTW: b:browsefilter is also supported by the GTK Gui. You can check by
 
 :echo has(browsefilter)
Oh! That's right. Thanks for your advice.
I update a patch.

Best regards,
Hirohito Higashi


 
 
 
 Best,
 
 Christian

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
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	Wed Nov 27 00:17:00 2013 +0900
@@ -26,25 +26,6 @@
 nnoremap silent buffer ]m :call SIDPython_jump('/^\s*\(class\\|def\)')cr
 nnoremap silent buffer [m :call SIDPython_jump('?^\s*\(class\\|def\)')cr
 
-if exists('*SIDPython_jump') | finish | endif
-
-fun! SIDPython_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(browsefilter)
+	let b:browsefilter = Python Files (*.py)\t*.py\n .
+			\ All Files (*.*)\t*.*\n
+endif
+
+if !exists('*SIDPython_jump') 
+	fun! SIDPython_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