aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-03-27 13:45:29 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-03-27 13:45:29 -0400
commit7785897657cd9c3a5e1483ebacad73939f375a7e (patch)
treeb168e4ec9c72248be21841807177870a07f32659 /src
parentf65b2b2a66f05b20010256ca1d81cc3252ea1471 (diff)
downloadtextadept-7785897657cd9c3a5e1483ebacad73939f375a7e.tar.gz
textadept-7785897657cd9c3a5e1483ebacad73939f375a7e.zip
Added basic project support for snapopen and build scripts.
Also fixed some curses errors introduced by the last commit.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile9
-rw-r--r--src/textadept.c10
2 files changed, 13 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile
index 563fdfe6..9521d575 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -182,11 +182,16 @@ lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \
lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o \
lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loadlib.o loslib.o ltablib.o lstrlib.o
-lua_lib_objs = lpeg.o lfs.o lspawn.o
+lua_lib_objs = lpeg.o lfs.o
#lua_lib_objs = lpcap.o lpcode.o lpprint.o lptree.o lpvm.o lfs.o
-luajit_lib_objs = lpegjit.o lfsjit.o lspawnjit.o
+luajit_lib_objs = lpegjit.o lfsjit.o
#luajit_lib_objs = lpcapjit.o lpcodejit.o lpprintjit.o lptreejit.o lpvmjit.o \
# lfsjit.o
+ifneq (curses, $(findstring curses, $(MAKECMDGOALS)))
+ # Compile in lspawn module.
+ lua_lib_objs += lspawn.o
+ luajit_lib_objs += lspawnjit.o
+endif
termkey_objs = termkey.o driver-ti.o driver-csi.o
windowman_objs = windowman.o
cdk_objs = binding.o buttonbox.o button.o cdk.o cdk_display.o cdk_objs.o \
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;
}