0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 7.4.1646

Problem:    Using Python vim.bindeval() on a partial doesn't work. (Nikolai
            Pavlov)
Solution:   Add VAR_PARTIAL support in Python.
This commit is contained in:
Bram Moolenaar
2016-03-24 21:58:12 +01:00
parent c5fbe8af4c
commit 4c90861e9f
3 changed files with 30 additions and 1 deletions

View File

@@ -6032,13 +6032,26 @@ ConvertToPyObject(typval_T *tv)
case VAR_FUNC:
return NEW_FUNCTION(tv->vval.v_string == NULL
? (char_u *)"" : tv->vval.v_string);
case VAR_PARTIAL:
return NEW_FUNCTION(tv->vval.v_partial == NULL
? (char_u *)"" : tv->vval.v_partial->pt_name);
case VAR_UNKNOWN:
case VAR_CHANNEL:
case VAR_JOB:
Py_INCREF(Py_None);
return Py_None;
default:
case VAR_SPECIAL:
switch (tv->vval.v_number)
{
case VVAL_FALSE: return AlwaysFalse(NULL);
case VVAL_TRUE: return AlwaysTrue(NULL);
case VVAL_NONE:
case VVAL_NULL: return AlwaysNone(NULL);
}
PyErr_SET_VIM(N_("internal error: invalid value type"));
return NULL;
}
return NULL;
}
typedef struct