File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -6032,13 +6032,26 @@ ConvertToPyObject(typval_T *tv)
60326032 case VAR_FUNC :
60336033 return NEW_FUNCTION (tv -> vval .v_string == NULL
60346034 ? (char_u * )"" : tv -> vval .v_string );
6035+ case VAR_PARTIAL :
6036+ return NEW_FUNCTION (tv -> vval .v_partial == NULL
6037+ ? (char_u * )"" : tv -> vval .v_partial -> pt_name );
60356038 case VAR_UNKNOWN :
6039+ case VAR_CHANNEL :
6040+ case VAR_JOB :
60366041 Py_INCREF (Py_None );
60376042 return Py_None ;
6038- default :
6043+ case VAR_SPECIAL :
6044+ switch (tv -> vval .v_number )
6045+ {
6046+ case VVAL_FALSE : return AlwaysFalse (NULL );
6047+ case VVAL_TRUE : return AlwaysTrue (NULL );
6048+ case VVAL_NONE :
6049+ case VVAL_NULL : return AlwaysNone (NULL );
6050+ }
60396051 PyErr_SET_VIM (N_ ("internal error: invalid value type" ));
60406052 return NULL ;
60416053 }
6054+ return NULL ;
60426055}
60436056
60446057typedef struct
Original file line number Diff line number Diff line change @@ -206,3 +206,17 @@ func Test_redefine_dict_func()
206206 call assert_true (v: errmsg , v: exception )
207207 endtry
208208endfunc
209+
210+ func Test_bind_in_python ()
211+ if has (' python' )
212+ let g: d = {}
213+ function g: d .test2 ()
214+ endfunction
215+ python import vim
216+ try
217+ call assert_equal (pyeval (' vim.bindeval("g:d.test2")' ), g: d .test2)
218+ catch
219+ call assert_true (v: false , v: exception )
220+ endtry
221+ endif
222+ endfunc
Original file line number Diff line number Diff line change @@ -748,6 +748,8 @@ static char *(features[]) =
748748
749749static int included_patches [] =
750750{ /* Add new patch number below this line */
751+ /**/
752+ 1646 ,
751753/**/
752754 1645 ,
753755/**/
You can’t perform that action at this time.
0 commit comments