@@ -196,9 +196,9 @@ static void showmap(mapblock_T *mp, bool local)
196196// Use false below if we only want things like <Up> to show up as such on
197197// the rhs, and not M-x etc, true gets both -- webb
198198if (mp -> m_luaref != LUA_NOREF ) {
199- char msg [ 100 ] ;
200- snprintf ( msg , sizeof ( msg ), "<Lua function %d>" , mp -> m_luaref );
201- msg_puts_attr ( msg , HL_ATTR ( HLF_8 ) );
199+ char * str = nlua_funcref_str ( mp -> m_luaref ) ;
200+ msg_puts_attr ( str , HL_ATTR ( HLF_8 ) );
201+ xfree ( str );
202202 }else if (mp -> m_str [0 ]== NUL ) {
203203msg_puts_attr ("<Nop>" ,HL_ATTR (HLF_8 ));
204204 }else {
@@ -2091,10 +2091,7 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
20912091rettv -> vval .v_string = str2special_save ((char * )rhs , false, false);
20922092 }
20932093 }else if (rhs_lua != LUA_NOREF ) {
2094- size_t msglen = 100 ;
2095- char * msg = (char * )xmalloc (msglen );
2096- snprintf (msg ,msglen ,"<Lua function %d>" ,mp -> m_luaref );
2097- rettv -> vval .v_string = msg ;
2094+ rettv -> vval .v_string = nlua_funcref_str (mp -> m_luaref );
20982095 }
20992096 }else {
21002097tv_dict_alloc_ret (rettv );