> On Saturday, March 23, 2019 at 5:42:36 PM UTC+1, Bram Moolenaar wrote:
> > Patch 8.1.1045
> > Problem:    E315 ml_get error when using Python and hidden buffer.
> > Solution:   Make sure the cursor position is valid. (Ben Jackson,
> >             closes #4153, closes #4154)
> > Files:          src/if_py_both.h, src/testdir/test_python2.vim,
> >             src/testdir/test_python3.vim
> 
> [...]
> 
> > + func _SetUpHiddenBuffer()
> > +   py import vim
> > +   new
> > +   edit hidden
> > +   setlocal bufhidden=hide
> > + 
> > +   enew
> > +   let lnum = 0
> > +   while lnum < 10
> > +     call append( 1, string( lnum ) )
> > +     let lnum = lnum + 1
> > +   endwhile
> > +   normal G
> > + 
> > +   call assert_equal( line( '.' ), 11 )
> > + endfunc
> > + 
> > + func Test_Write_To_HiddenBuffer_Does_Not_Fix_Cursor_Clear()
> > +   call _SetUpHiddenBuffer()
> > +   py vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][:] = None
> > +   call assert_equal( line( '.' ), 11 )
> > +   bwipe!
> 
> I think ":bwipe! hidden" should be added here so as not to "leak" buffers.
> The same goes for each of the other test functions.

Yes, that's safer.  Re-using the same hidden buffer is not what the test
expects.

-- 
hundred-and-one symptoms of being an internet addict:
107. When using your phone you forget that you don't have to use your
     keyboard.

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui