| File src/lua/vifm_viewcolumns.c changed (mode: 100644) (index 8c6b0b544..f241b5e59) |
| ... |
... |
lua_viewcolumn_handler(void *data, size_t buf_len, char buf[], |
| 231 |
231 |
const char *error = lua_tostring(lua, -1); |
const char *error = lua_tostring(lua, -1); |
| 232 |
232 |
ui_sb_err(error); |
ui_sb_err(error); |
| 233 |
233 |
copy_str(buf, buf_len, "ERROR"); |
copy_str(buf, buf_len, "ERROR"); |
| 234 |
|
lua_pop(lua, 1); |
|
|
234 |
|
lua_pop(lua, 1); /* error */ |
| 235 |
235 |
return; |
return; |
| 236 |
236 |
} |
} |
| 237 |
237 |
|
|
| |
| ... |
... |
lua_viewcolumn_handler(void *data, size_t buf_len, char buf[], |
| 240 |
240 |
if(!lua_istable(lua, -1)) |
if(!lua_istable(lua, -1)) |
| 241 |
241 |
{ |
{ |
| 242 |
242 |
copy_str(buf, buf_len, "NOVALUE"); |
copy_str(buf, buf_len, "NOVALUE"); |
| 243 |
|
lua_pop(lua, 1); |
|
|
243 |
|
lua_pop(lua, 1); /* handler's result */ |
| 244 |
244 |
return; |
return; |
| 245 |
245 |
} |
} |
| 246 |
246 |
|
|
| 247 |
247 |
if(lua_getfield(lua, -1, "text") == LUA_TNIL) |
if(lua_getfield(lua, -1, "text") == LUA_TNIL) |
| 248 |
248 |
{ |
{ |
| 249 |
249 |
copy_str(buf, buf_len, "NOVALUE"); |
copy_str(buf, buf_len, "NOVALUE"); |
| 250 |
|
lua_pop(lua, 2); |
|
|
250 |
|
lua_pop(lua, 2); /* text, handler's result */ |
| 251 |
251 |
return; |
return; |
| 252 |
252 |
} |
} |
| 253 |
253 |
|
|
| 254 |
254 |
const char *text = lua_tostring(lua, -1); |
const char *text = lua_tostring(lua, -1); |
| 255 |
255 |
copy_str(buf, buf_len, (text == NULL ? "NOVALUE" : text)); |
copy_str(buf, buf_len, (text == NULL ? "NOVALUE" : text)); |
| 256 |
|
lua_pop(lua, 1); |
|
|
256 |
|
lua_pop(lua, 1); /* text */ |
| 257 |
257 |
|
|
| 258 |
258 |
int has_start = (lua_getfield(lua, -1, "matchstart") == LUA_TNUMBER); |
int has_start = (lua_getfield(lua, -1, "matchstart") == LUA_TNUMBER); |
| 259 |
259 |
int has_end = (lua_getfield(lua, -2, "matchend") == LUA_TNUMBER); |
int has_end = (lua_getfield(lua, -2, "matchend") == LUA_TNUMBER); |
| |
| ... |
... |
lua_viewcolumn_handler(void *data, size_t buf_len, char buf[], |
| 270 |
270 |
} |
} |
| 271 |
271 |
} |
} |
| 272 |
272 |
|
|
| 273 |
|
lua_pop(lua, 3); |
|
|
273 |
|
lua_pop(lua, 3); /* matchend, matchstart, handler's result */ |
| 274 |
274 |
} |
} |
| 275 |
275 |
|
|
| 276 |
276 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |