From 7785897657cd9c3a5e1483ebacad73939f375a7e Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 27 Mar 2014 13:45:29 -0400 Subject: Added basic project support for snapopen and build scripts. Also fixed some curses errors introduced by the last commit. --- src/textadept.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/textadept.c') diff --git a/src/textadept.c b/src/textadept.c index d3d1dd67..e0c9e36f 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -210,7 +210,9 @@ static void new_buffer(sptr_t); static Scintilla *new_view(sptr_t); static int lL_init(lua_State *, int, char **, int); LUALIB_API int luaopen_lpeg(lua_State *), luaopen_lfs(lua_State *); +#if !CURSES LUALIB_API int luaopen_spawn(lua_State *); +#endif /** * Emits an event. @@ -1603,7 +1605,9 @@ static int lL_init(lua_State *L, int argc, char **argv, int reinit) { luaL_openlibs(L); lL_openlib(L, "lpeg", luaopen_lpeg); lL_openlib(L, "lfs", luaopen_lfs); +#if !CURSES lL_openlib(L, "spawn", luaopen_spawn); +#endif lua_newtable(L); lua_newtable(L); @@ -2125,11 +2129,9 @@ static Scintilla *new_view(sptr_t doc) { SS(view, SCI_USEPOPUP, 0, 0); lL_addview(lua, view); l_setglobalview(lua, view); + if (doc) SS(view, SCI_SETDOCPOINTER, 0, doc); focus_view(view), focused_view = view; - if (doc) { - SS(view, SCI_SETDOCPOINTER, 0, doc); - l_setglobaldoc(lua, doc); - } else new_buffer(SS(view, SCI_GETDOCPOINTER, 0, 0)); + if (!doc) new_buffer(SS(view, SCI_GETDOCPOINTER, 0, 0)); if (!initing) lL_event(lua, "view_new", -1); return view; } -- cgit v1.2.3