aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2018-04-25 22:52:33 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2018-04-25 22:52:33 -0400
commit5f4fbc763a90a38508a0a7d4f4ae7a2262ecbd39 (patch)
treea66ddc4caf4b8a9509330433571d586a6843fe27
parent795f72c6d49c0566517a43808ce7aaf405220f31 (diff)
downloadtextadept-5f4fbc763a90a38508a0a7d4f4ae7a2262ecbd39.tar.gz
textadept-5f4fbc763a90a38508a0a7d4f4ae7a2262ecbd39.zip
Removed LuaJIT version of Textadept.
Also updated to Lua 5.3 syntax where held back by LuaJIT's 5.1/5.2 syntax.
-rw-r--r--FAQ.md36
-rw-r--r--TECHNOLOGY.md4
-rw-r--r--core/.buffer.luadoc4
-rw-r--r--core/iface.lua2
-rw-r--r--core/init.lua11
-rw-r--r--core/ui.lua2
-rw-r--r--doc/manual.md89
-rw-r--r--init.lua9
-rw-r--r--modules/textadept/bookmarks.lua14
-rw-r--r--modules/textadept/editing.lua9
-rw-r--r--modules/textadept/run.lua8
-rw-r--r--modules/textadept/session.lua5
-rw-r--r--modules/textadept/snippets.lua13
-rwxr-xr-xscripts/gen_iface.lua2
-rwxr-xr-xscripts/osx/textadept_osx4
-rw-r--r--src/Makefile115
-rw-r--r--src/lfs.patch11
-rw-r--r--src/lua.sym26
-rw-r--r--src/luajit.patch63
-rw-r--r--src/lutf8libjit.patch14
-rw-r--r--src/textadept.c21
21 files changed, 93 insertions, 369 deletions
diff --git a/FAQ.md b/FAQ.md
index 188c0ce9..0f7e6466 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -1,34 +1,18 @@
# FAQ
**Q:**
-What is the difference between *textadept* and *textadeptjit*? Which one should
-I use?
-
-**A:**
-*textadept* uses Lua 5.3 while *textadeptjit* uses [LuaJIT][], which is based on
-Lua 5.1. Other than access to the [FFI Library][], *textadeptjit* does not
-provide any noteworthy benefits. It used to be the case that *textadeptjit* was
-slightly faster when loading large files, but Textadept 6.1 was the last version
-that had a noticible difference between the two. *textadept* is recommended.
-
-[LuaJIT]: http://luajit.org
-[FFI library]: http://luajit.org/ext_ffi.html
-
-- - -
-
-**Q:**
If Textadept is so minimalist, why are the downloads around 10MB in size and the
unzipped folders 10s of MBs in size?
**A:**
-Each download contains 4 executables: 2 GUI versions and 2 terminal versions
-(each version uses either Lua or LuaJIT). Furthermore, the Windows and OSX
-packages bundle in GTK+ runtimes, accounting for some 3/4 of the total
-application size. (GTK+ is the cross-platform GUI toolkit Textadept uses.)
-Then, starting in version 10, in order to be able to run on older Linux systems
-whose libstdc++ does not support newer C++11 symbols, the Linux executables
-statically link in a newer version of libstdc++. Finally, nightly builds are
-compiled with debug symbols enabled in order to aid debugging of various issues.
+Each download contains 2 executables: a GUI version and a terminal version.
+Furthermore, the Windows and OSX packages bundle in GTK+ runtimes, accounting
+for some 3/4 of the total application size. (GTK+ is the cross-platform GUI
+toolkit Textadept uses.) Then, starting in version 10, in order to be able to
+run on older Linux systems whose libstdc++ does not support newer C++11 symbols,
+the Linux executables statically link in a newer version of libstdc++. Finally,
+nightly builds are compiled with debug symbols enabled in order to aid debugging
+of various issues.
- - -
@@ -58,8 +42,8 @@ is this a false-positive?
**A:**
Textadept does not contain any viruses and it certainly is a false positive.
-The likely culprits are the `textadept-curses.exe` and `textadeptjit-curses.exe`
-executables, which run in the Windows command prompt.
+The likely culprit is the `textadept-curses.exe` executable, which runs in the
+Windows command prompt.
- - -
diff --git a/TECHNOLOGY.md b/TECHNOLOGY.md
index 309a9f11..81ccba97 100644
--- a/TECHNOLOGY.md
+++ b/TECHNOLOGY.md
@@ -40,9 +40,6 @@ Lua and includes a few external libraries.
Textadept uses Lua as its internal scripting language. Most of Textadept is
written in Lua.
-=[LuaJIT][] - Just in Time Compiler for Lua=
- Textadept optionally uses LuaJIT as a substitute for vanilla Lua.
-
=[LPeg][] - Parsing Expression Grammars for Lua=
Textadept uses LPeg in its Scintilla lexers.
@@ -57,7 +54,6 @@ Lua and includes a few external libraries.
[GTK+]: http://www.gtk.org
[Scintilla]: http://scintilla.org
[Lua]: http://www.lua.org
-[LuaJIT]: http://luajit.org
[LPeg]: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
[LuaFileSystem]: http://keplerproject.github.io/luafilesystem/
[lspawn]: http://foicica.com/hg/lspawn
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc
index f1b42a11..7207181b 100644
--- a/core/.buffer.luadoc
+++ b/core/.buffer.luadoc
@@ -507,8 +507,8 @@
-- default).
-- Bit-masks are 32-bit values whose bits correspond to the 32 available
-- markers.
--- The default values are `0`, `bit32.bnot(buffer.MASK_FOLDERS)`, `0`, `0`,
--- and `0`, for a line margin and logical marker margin.
+-- The default values are `0`, `~buffer.MASK_FOLDERS`, `0`, `0`, and `0`, for
+-- a line margin and logical marker margin.
-- @field margin_options (number)
-- A bit-mask of margin option settings.
--
diff --git a/core/iface.lua b/core/iface.lua
index b4c22ea9..66252c6a 100644
--- a/core/iface.lua
+++ b/core/iface.lua
@@ -14,7 +14,7 @@ module('_SCINTILLA')]]
-- @class table
-- @name constants
-- @see _G.buffer
-M.constants = {ACCESSIBILITY_DISABLED=0,ACCESSIBILITY_ENABLED=1,ALPHA_NOALPHA=256,ALPHA_OPAQUE=255,ALPHA_TRANSPARENT=0,ANNOTATION_BOXED=2,ANNOTATION_HIDDEN=0,ANNOTATION_INDENTED=3,ANNOTATION_STANDARD=1,AUTOMATICFOLD_CHANGE=0x0004,AUTOMATICFOLD_CLICK=0x0002,AUTOMATICFOLD_SHOW=0x0001,CARETSTICKY_OFF=0,CARETSTICKY_ON=1,CARETSTICKY_WHITESPACE=2,CARETSTYLE_BLOCK=2,CARETSTYLE_INVISIBLE=0,CARETSTYLE_LINE=1,CARET_EVEN=0x08,CARET_JUMPS=0x10,CARET_SLOP=0x01,CARET_STRICT=0x04,CASEINSENSITIVEBEHAVIOUR_IGNORECASE=1,CASEINSENSITIVEBEHAVIOUR_RESPECTCASE=0,CASE_CAMEL=3,CASE_LOWER=2,CASE_MIXED=0,CASE_UPPER=1,CP_UTF8=65001,CURSORARROW=2,CURSORNORMAL=-1,CURSORREVERSEARROW=7,CURSORWAIT=4,EDGE_BACKGROUND=2,EDGE_LINE=1,EDGE_MULTILINE=3,EDGE_NONE=0,EOL_CR=1,EOL_CRLF=0,EOL_LF=2,FIND_CXX11REGEX=0x00800000,FIND_MATCHCASE=0x4,FIND_REGEXP=6291456,FIND_WHOLEWORD=0x2,FIND_WORDSTART=0x00100000,FOLDACTION_CONTRACT=0,FOLDACTION_EXPAND=1,FOLDACTION_TOGGLE=2,FOLDDISPLAYTEXT_BOXED=2,FOLDDISPLAYTEXT_HIDDEN=0,FOLDDISPLAYTEXT_STANDARD=1,FOLDFLAG_LEVELNUMBERS=0x0040,FOLDFLAG_LINEAFTER_CONTRACTED=0x0010,FOLDFLAG_LINEAFTER_EXPANDED=0x0008,FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004,FOLDFLAG_LINEBEFORE_EXPANDED=0x0002,FOLDFLAG_LINESTATE=0x0080,FOLDLEVELBASE=0x400,FOLDLEVELHEADERFLAG=0x2000,FOLDLEVELNUMBERMASK=0x0FFF,FOLDLEVELWHITEFLAG=0x1000,IDLESTYLING_AFTERVISIBLE=2,IDLESTYLING_ALL=3,IDLESTYLING_NONE=0,IDLESTYLING_TOVISIBLE=1,IME_INLINE=1,IME_WINDOWED=0,INDIC_BOX=6,INDIC_COMPOSITIONTHICK=14,INDIC_COMPOSITIONTHIN=15,INDIC_CONTAINER=8,INDIC_DASH=9,INDIC_DIAGONAL=3,INDIC_DOTBOX=12,INDIC_DOTS=10,INDIC_FULLBOX=16,INDIC_HIDDEN=5,INDIC_IME=32,INDIC_IME_MAX=35,INDIC_MAX=35,INDIC_PLAIN=0,INDIC_POINT=18,INDIC_POINTCHARACTER=19,INDIC_ROUNDBOX=7,INDIC_SQUIGGLE=1,INDIC_SQUIGGLELOW=11,INDIC_SQUIGGLEPIXMAP=13,INDIC_STRAIGHTBOX=8,INDIC_STRIKE=4,INDIC_TEXTFORE=17,INDIC_TT=2,IV_LOOKBOTH=3,IV_LOOKFORWARD=2,IV_NONE=0,IV_REAL=1,LASTSTEPINUNDOREDO=0x100,MARGINOPTION_NONE=0,MARGINOPTION_SUBLINESELECT=1,MARGIN_BACK=2,MARGIN_COLOUR=6,MARGIN_FORE=3,MARGIN_NUMBER=1,MARGIN_RTEXT=5,MARGIN_SYMBOL=0,MARGIN_TEXT=4,MARKER_MAX=31,MARKNUM_FOLDER=30,MARKNUM_FOLDEREND=25,MARKNUM_FOLDERMIDTAIL=27,MARKNUM_FOLDEROPEN=31,MARKNUM_FOLDEROPENMID=26,MARKNUM_FOLDERSUB=29,MARKNUM_FOLDERTAIL=28,MARK_ARROW=2,MARK_ARROWDOWN=6,MARK_ARROWS=24,MARK_AVAILABLE=28,MARK_BACKGROUND=22,MARK_BOOKMARK=31,MARK_BOXMINUS=14,MARK_BOXMINUSCONNECTED=15,MARK_BOXPLUS=12,MARK_BOXPLUSCONNECTED=13,MARK_CHARACTER=10000,MARK_CIRCLE=0,MARK_CIRCLEMINUS=20,MARK_CIRCLEMINUSCONNECTED=21,MARK_CIRCLEPLUS=18,MARK_CIRCLEPLUSCONNECTED=19,MARK_DOTDOTDOT=23,MARK_EMPTY=5,MARK_FULLRECT=26,MARK_LCORNER=10,MARK_LCORNERCURVE=16,MARK_LEFTRECT=27,MARK_MINUS=7,MARK_PIXMAP=25,MARK_PLUS=8,MARK_RGBAIMAGE=30,MARK_ROUNDRECT=1,MARK_SHORTARROW=4,MARK_SMALLRECT=3,MARK_TCORNER=11,MARK_TCORNERCURVE=17,MARK_UNDERLINE=29,MARK_VLINE=9,MASK_FOLDERS=-33554432,MAX_MARGIN=4,MODEVENTMASKALL=0x3FFFFF,MOD_ALT=4,MOD_BEFOREDELETE=0x800,MOD_BEFOREINSERT=0x400,MOD_CHANGEANNOTATION=0x20000,MOD_CHANGEFOLD=0x8,MOD_CHANGEINDICATOR=0x4000,MOD_CHANGELINESTATE=0x8000,MOD_CHANGEMARGIN=0x10000,MOD_CHANGEMARKER=0x200,MOD_CHANGESTYLE=0x4,MOD_CHANGETABSTOPS=0x200000,MOD_CONTAINER=0x40000,MOD_CTRL=2,MOD_DELETETEXT=0x2,MOD_INSERTCHECK=0x100000,MOD_INSERTTEXT=0x1,MOD_LEXERSTATE=0x80000,MOD_META=16,MOD_NORM=0,MOD_SHIFT=1,MOD_SUPER=8,MOUSE_DRAG=2,MOUSE_PRESS=1,MOUSE_RELEASE=3,MULTIAUTOC_EACH=1,MULTIAUTOC_ONCE=0,MULTILINEUNDOREDO=0x1000,MULTIPASTE_EACH=1,MULTIPASTE_ONCE=0,MULTISTEPUNDOREDO=0x80,ORDER_CUSTOM=2,ORDER_PERFORMSORT=1,ORDER_PRESORTED=0,PERFORMED_REDO=0x40,PERFORMED_UNDO=0x20,PERFORMED_USER=0x10,SCN_AUTOCCANCELLED=2025,SCN_AUTOCCHARDELETED=2026,SCN_AUTOCCOMPLETED=2030,SCN_AUTOCSELECTION=2022,SCN_AUTOCSELECTIONCHANGE=2032,SCN_CALLTIPCLICK=2021,SCN_CHARADDED=2001,SCN_DOUBLECLICK=2006,SCN_DWELLEND=2017,SCN_DWELLSTART=2016,SCN_FOCUSIN=2028,SCN_FOCUSOUT=2029,SCN_HOTSPOTCLICK=2019,SCN_HOTSPOTDOUBLECLICK=2020,SCN_HOTSPOTRELEASECLICK=2027,SCN_INDICATORCLICK=2023,SCN_INDICATORRELEASE=2024,SCN_KEY=2005,SCN_MACRORECORD=2009,SCN_MARGINCLICK=2010,SCN_MARGINRIGHTCLICK=2031,SCN_MODIFIED=2008,SCN_MODIFYATTEMPTRO=2004,SCN_NEEDSHOWN=2011,SCN_PAINTED=2013,SCN_SAVEPOINTLEFT=2003,SCN_SAVEPOINTREACHED=2002,SCN_STYLENEEDED=2000,SCN_UPDATEUI=2007,SCN_URIDROPPED=2015,SCN_USERLISTSELECTION=2014,SCN_ZOOM=2018,SEL_LINES=2,SEL_RECTANGLE=1,SEL_STREAM=0,SEL_THIN=3,STARTACTION=0x2000,STYLE_BRACEBAD=35,STYLE_BRACELIGHT=34,STYLE_CALLTIP=38,STYLE_CONTROLCHAR=36,STYLE_DEFAULT=32,STYLE_FOLDDISPLAYTEXT=39,STYLE_INDENTGUIDE=37,STYLE_LASTPREDEFINED=39,STYLE_LINENUMBER=33,STYLE_MAX=255,TD_LONGARROW=0,TD_STRIKEOUT=1,TIME_FOREVER=10000000,UPDATE_CONTENT=0x1,UPDATE_H_SCROLL=0x8,UPDATE_SELECTION=0x2,UPDATE_V_SCROLL=0x4,VISIBLE_SLOP=0x01,VISIBLE_STRICT=0x04,VS_NONE=0,VS_NOWRAPLINESTART=4,VS_RECTANGULARSELECTION=1,VS_USERACCESSIBLE=2,WRAPINDENT_FIXED=0,WRAPINDENT_INDENT=2,WRAPINDENT_SAME=1,WRAPVISUALFLAGLOC_DEFAULT=0x0000,WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001,WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002,WRAPVISUALFLAG_END=0x0001,WRAPVISUALFLAG_MARGIN=0x0004,WRAPVISUALFLAG_NONE=0x0000,WRAPVISUALFLAG_START=0x0002,WRAP_CHAR=2,WRAP_NONE=0,WRAP_WHITESPACE=3,WRAP_WORD=1,WS_INVISIBLE=0,WS_VISIBLEAFTERINDENT=2,WS_VISIBLEALWAYS=1,WS_VISIBLEONLYININDENT=3}
+M.constants = {ACCESSIBILITY_DISABLED=0,ACCESSIBILITY_ENABLED=1,ALPHA_NOALPHA=256,ALPHA_OPAQUE=255,ALPHA_TRANSPARENT=0,ANNOTATION_BOXED=2,ANNOTATION_HIDDEN=0,ANNOTATION_INDENTED=3,ANNOTATION_STANDARD=1,AUTOMATICFOLD_CHANGE=0x0004,AUTOMATICFOLD_CLICK=0x0002,AUTOMATICFOLD_SHOW=0x0001,CARETSTICKY_OFF=0,CARETSTICKY_ON=1,CARETSTICKY_WHITESPACE=2,CARETSTYLE_BLOCK=2,CARETSTYLE_INVISIBLE=0,CARETSTYLE_LINE=1,CARET_EVEN=0x08,CARET_JUMPS=0x10,CARET_SLOP=0x01,CARET_STRICT=0x04,CASEINSENSITIVEBEHAVIOUR_IGNORECASE=1,CASEINSENSITIVEBEHAVIOUR_RESPECTCASE=0,CASE_CAMEL=3,CASE_LOWER=2,CASE_MIXED=0,CASE_UPPER=1,CP_UTF8=65001,CURSORARROW=2,CURSORNORMAL=-1,CURSORREVERSEARROW=7,CURSORWAIT=4,EDGE_BACKGROUND=2,EDGE_LINE=1,EDGE_MULTILINE=3,EDGE_NONE=0,EOL_CR=1,EOL_CRLF=0,EOL_LF=2,FIND_CXX11REGEX=0x00800000,FIND_MATCHCASE=0x4,FIND_REGEXP=10485760,FIND_WHOLEWORD=0x2,FIND_WORDSTART=0x00100000,FOLDACTION_CONTRACT=0,FOLDACTION_EXPAND=1,FOLDACTION_TOGGLE=2,FOLDDISPLAYTEXT_BOXED=2,FOLDDISPLAYTEXT_HIDDEN=0,FOLDDISPLAYTEXT_STANDARD=1,FOLDFLAG_LEVELNUMBERS=0x0040,FOLDFLAG_LINEAFTER_CONTRACTED=0x0010,FOLDFLAG_LINEAFTER_EXPANDED=0x0008,FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004,FOLDFLAG_LINEBEFORE_EXPANDED=0x0002,FOLDFLAG_LINESTATE=0x0080,FOLDLEVELBASE=0x400,FOLDLEVELHEADERFLAG=0x2000,FOLDLEVELNUMBERMASK=0x0FFF,FOLDLEVELWHITEFLAG=0x1000,IDLESTYLING_AFTERVISIBLE=2,IDLESTYLING_ALL=3,IDLESTYLING_NONE=0,IDLESTYLING_TOVISIBLE=1,IME_INLINE=1,IME_WINDOWED=0,INDIC_BOX=6,INDIC_COMPOSITIONTHICK=14,INDIC_COMPOSITIONTHIN=15,INDIC_CONTAINER=8,INDIC_DASH=9,INDIC_DIAGONAL=3,INDIC_DOTBOX=12,INDIC_DOTS=10,INDIC_FULLBOX=16,INDIC_HIDDEN=5,INDIC_IME=32,INDIC_IME_MAX=35,INDIC_MAX=35,INDIC_PLAIN=0,INDIC_POINT=18,INDIC_POINTCHARACTER=19,INDIC_ROUNDBOX=7,INDIC_SQUIGGLE=1,INDIC_SQUIGGLELOW=11,INDIC_SQUIGGLEPIXMAP=13,INDIC_STRAIGHTBOX=8,INDIC_STRIKE=4,INDIC_TEXTFORE=17,INDIC_TT=2,IV_LOOKBOTH=3,IV_LOOKFORWARD=2,IV_NONE=0,IV_REAL=1,LASTSTEPINUNDOREDO=0x100,MARGINOPTION_NONE=0,MARGINOPTION_SUBLINESELECT=1,MARGIN_BACK=2,MARGIN_COLOUR=6,MARGIN_FORE=3,MARGIN_NUMBER=1,MARGIN_RTEXT=5,MARGIN_SYMBOL=0,MARGIN_TEXT=4,MARKER_MAX=31,MARKNUM_FOLDER=30,MARKNUM_FOLDEREND=25,MARKNUM_FOLDERMIDTAIL=27,MARKNUM_FOLDEROPEN=31,MARKNUM_FOLDEROPENMID=26,MARKNUM_FOLDERSUB=29,MARKNUM_FOLDERTAIL=28,MARK_ARROW=2,MARK_ARROWDOWN=6,MARK_ARROWS=24,MARK_AVAILABLE=28,MARK_BACKGROUND=22,MARK_BOOKMARK=31,MARK_BOXMINUS=14,MARK_BOXMINUSCONNECTED=15,MARK_BOXPLUS=12,MARK_BOXPLUSCONNECTED=13,MARK_CHARACTER=10000,MARK_CIRCLE=0,MARK_CIRCLEMINUS=20,MARK_CIRCLEMINUSCONNECTED=21,MARK_CIRCLEPLUS=18,MARK_CIRCLEPLUSCONNECTED=19,MARK_DOTDOTDOT=23,MARK_EMPTY=5,MARK_FULLRECT=26,MARK_LCORNER=10,MARK_LCORNERCURVE=16,MARK_LEFTRECT=27,MARK_MINUS=7,MARK_PIXMAP=25,MARK_PLUS=8,MARK_RGBAIMAGE=30,MARK_ROUNDRECT=1,MARK_SHORTARROW=4,MARK_SMALLRECT=3,MARK_TCORNER=11,MARK_TCORNERCURVE=17,MARK_UNDERLINE=29,MARK_VLINE=9,MASK_FOLDERS=-33554432,MAX_MARGIN=4,MODEVENTMASKALL=0x3FFFFF,MOD_ALT=4,MOD_BEFOREDELETE=0x800,MOD_BEFOREINSERT=0x400,MOD_CHANGEANNOTATION=0x20000,MOD_CHANGEFOLD=0x8,MOD_CHANGEINDICATOR=0x4000,MOD_CHANGELINESTATE=0x8000,MOD_CHANGEMARGIN=0x10000,MOD_CHANGEMARKER=0x200,MOD_CHANGESTYLE=0x4,MOD_CHANGETABSTOPS=0x200000,MOD_CONTAINER=0x40000,MOD_CTRL=2,MOD_DELETETEXT=0x2,MOD_INSERTCHECK=0x100000,MOD_INSERTTEXT=0x1,MOD_LEXERSTATE=0x80000,MOD_META=16,MOD_NORM=0,MOD_SHIFT=1,MOD_SUPER=8,MOUSE_DRAG=2,MOUSE_PRESS=1,MOUSE_RELEASE=3,MULTIAUTOC_EACH=1,MULTIAUTOC_ONCE=0,MULTILINEUNDOREDO=0x1000,MULTIPASTE_EACH=1,MULTIPASTE_ONCE=0,MULTISTEPUNDOREDO=0x80,ORDER_CUSTOM=2,ORDER_PERFORMSORT=1,ORDER_PRESORTED=0,PERFORMED_REDO=0x40,PERFORMED_UNDO=0x20,PERFORMED_USER=0x10,SCN_AUTOCCANCELLED=2025,SCN_AUTOCCHARDELETED=2026,SCN_AUTOCCOMPLETED=2030,SCN_AUTOCSELECTION=2022,SCN_AUTOCSELECTIONCHANGE=2032,SCN_CALLTIPCLICK=2021,SCN_CHARADDED=2001,SCN_DOUBLECLICK=2006,SCN_DWELLEND=2017,SCN_DWELLSTART=2016,SCN_FOCUSIN=2028,SCN_FOCUSOUT=2029,SCN_HOTSPOTCLICK=2019,SCN_HOTSPOTDOUBLECLICK=2020,SCN_HOTSPOTRELEASECLICK=2027,SCN_INDICATORCLICK=2023,SCN_INDICATORRELEASE=2024,SCN_KEY=2005,SCN_MACRORECORD=2009,SCN_MARGINCLICK=2010,SCN_MARGINRIGHTCLICK=2031,SCN_MODIFIED=2008,SCN_MODIFYATTEMPTRO=2004,SCN_NEEDSHOWN=2011,SCN_PAINTED=2013,SCN_SAVEPOINTLEFT=2003,SCN_SAVEPOINTREACHED=2002,SCN_STYLENEEDED=2000,SCN_UPDATEUI=2007,SCN_URIDROPPED=2015,SCN_USERLISTSELECTION=2014,SCN_ZOOM=2018,SEL_LINES=2,SEL_RECTANGLE=1,SEL_STREAM=0,SEL_THIN=3,STARTACTION=0x2000,STYLE_BRACEBAD=35,STYLE_BRACELIGHT=34,STYLE_CALLTIP=38,STYLE_CONTROLCHAR=36,STYLE_DEFAULT=32,STYLE_FOLDDISPLAYTEXT=39,STYLE_INDENTGUIDE=37,STYLE_LASTPREDEFINED=39,STYLE_LINENUMBER=33,STYLE_MAX=255,TD_LONGARROW=0,TD_STRIKEOUT=1,TIME_FOREVER=10000000,UPDATE_CONTENT=0x1,UPDATE_H_SCROLL=0x8,UPDATE_SELECTION=0x2,UPDATE_V_SCROLL=0x4,VISIBLE_SLOP=0x01,VISIBLE_STRICT=0x04,VS_NONE=0,VS_NOWRAPLINESTART=4,VS_RECTANGULARSELECTION=1,VS_USERACCESSIBLE=2,WRAPINDENT_FIXED=0,WRAPINDENT_INDENT=2,WRAPINDENT_SAME=1,WRAPVISUALFLAGLOC_DEFAULT=0x0000,WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001,WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002,WRAPVISUALFLAG_END=0x0001,WRAPVISUALFLAG_MARGIN=0x0004,WRAPVISUALFLAG_NONE=0x0000,WRAPVISUALFLAG_START=0x0002,WRAP_CHAR=2,WRAP_NONE=0,WRAP_WHITESPACE=3,WRAP_WORD=1,WS_INVISIBLE=0,WS_VISIBLEAFTERINDENT=2,WS_VISIBLEALWAYS=1,WS_VISIBLEONLYININDENT=3}
---
-- Map of Scintilla function names to tables containing their IDs, return types,
diff --git a/core/init.lua b/core/init.lua
index aa6ece5d..8acc3660 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -16,17 +16,6 @@ require('ui')
keys = require('keys')
_M = {} -- language modules table
--- LuaJIT compatibility.
-if jit then
- module, package.searchers, bit32 = nil, package.loaders, bit
- -- In Lua 5.3, the `table` library respects metamethods. Redefine at least the
- -- functions Textadept may depend on.
- table.insert = function(list, pos, value)
- if not value then value, pos = pos, #list + 1 end
- for i = #list, pos, -1 do list[i + 1] = list[i] end
- list[pos] = value
- end
-end
-- pdcurses compatibility.
if CURSES and WIN32 then
function spawn(argv, cwd, ...)
diff --git a/core/ui.lua b/core/ui.lua
index b725c900..e60e497c 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -307,7 +307,7 @@ end)
local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1]
-- Sets buffer statusbar text.
events_connect(events.UPDATE_UI, function(updated)
- if updated and bit32.band(updated, 3) == 0 then return end -- ignore scrolling
+ if updated and updated & 3 == 0 then return end -- ignore scrolling
local pos = buffer.current_pos
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count
local col = buffer.column[pos] + 1
diff --git a/doc/manual.md b/doc/manual.md
index d6092d21..cef18ec7 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -39,10 +39,7 @@ speed or succumbing to code bloat and featuritis.
Textadept is _fast_. It starts up instantly and has a very responsive user
interface. Even though the editor consists primarily of Lua, Lua is one of the
-fastest scripting languages available. With the optional [LuaJIT][] version,
-Textadept runs faster than ever before.
-
-[LuaJIT]: http://luajit.org
+fastest scripting languages available.
### Minimalist
@@ -200,15 +197,8 @@ You can also create a symbolic link to the executable in a directory in your
"$PATH" (e.g. */usr/local/bin/*) or make a GNOME, KDE, XFCE, etc. button or menu
launcher.
-The package also contains a *textadeptjit* executable for running Textadept with
-[LuaJIT][]. Due to potential [compatibility issues](#LuaJIT), use the
-*textadept* executable wherever possible.
-
-The *textadept-curses* and *textadeptjit-curses* executables are the terminal
-versions of Textadept. Run them as you would run the *textadept* and
-*textadeptjit* executables, but from a terminal instead.
-
-[LuaJIT]: http://luajit.org
+The *textadept-curses* executable is the terminal version of Textadept. Run them
+as you would run the *textadept* executable, but from a terminal instead.
#### Runtime Problems
@@ -228,15 +218,6 @@ painless even though it requires [recompiling](#Compiling) Textadept.
Run Textadept by double-clicking *Textadept.app*. You can also pin it to your
dock.
-*Textadept.app* also contains an executable for running Textadept with
-[LuaJIT][]. Enable it by setting a "TEXTADEPTJIT"
-[environment variable](#Mac.OSX.Environment.Variables) or by typing
-`export TEXTADEPTJIT=1` in the terminal. Due to potential
-[compatibility issues](#LuaJIT), use the non-LuaJIT executable wherever
-possible.
-
-[LuaJIT]: http://luajit.org
-
#### Mac OSX Environment Variables
By default, Mac OSX GUI apps like Textadept do not see shell environment
@@ -253,12 +234,6 @@ example:
Run Textadept by double-clicking *textadept.exe*. You can also create shortcuts
to the executable in your Start Menu, Quick Launch toolbar, Desktop, etc.
-The package also contains a *textadeptjit.exe* executable for running Textadept
-with [LuaJIT][]. Due to potential [compatibility issues](#LuaJIT), use the
-*textadept.exe* executable wherever possible.
-
-[LuaJIT]: http://luajit.org
-
#### Portable Textadept
You can create a portable version of Textadept by creating a shortcut to the
@@ -1553,15 +1528,6 @@ Textadept contains its own copy of [Lua 5.3][] which has the same configuration
[Lua 5.3]: http://www.lua.org/manual/5.3/
-### LuaJIT
-
-Even though Textadept runs with [LuaJIT][], LuaJIT does not fully support
-Lua 5.3. Therefore, try to write your modules and scripts to be compatible with
-both versions. For the most part, LuaJIT only lacks Lua 5.2's `_ENV` and Lua
-5.3's new bitwise operators and some new integer operations.
-
-[LuaJIT]: http://luajit.org
-
## Scintilla
Textadept uses the [Scintilla][] editing component. The [buffer][] part of
@@ -1710,10 +1676,10 @@ Note: for BSD systems, replace the `make` commands below with `gmake`.
For Linux and BSD systems, simply run `make deps` (or `make deps NIGHTLY=1` when
compiling Textadept from the latest source rather than from a tagged release) in
the *src/* directory to prepare the build environment, followed by `make` to
-build the *textadept* and *textadeptjit* executables in the root directory. Make
-a symlink from them to */usr/bin/* or elsewhere in your `PATH`.
+build the *textadept* executable in the root directory. Make a symlink from them
+to */usr/bin/* or elsewhere in your `PATH`.
-Similarly, `make curses` builds *textadept-curses* and *textadeptjit-curses*.
+Similarly, `make curses` builds *textadept-curses*.
Note: you may have to run
@@ -1747,25 +1713,18 @@ compiler names. You may have to either modify the `CROSS` variable in the
compiler names, run `make win32-deps` or
`make CROSS=i586-mingw32msvc- win32-deps` to prepare the build environment
followed by `make win32` or `make CROSS=i586-mingw32msvc- win32` to build
-*../textadept.exe* and *../textadeptjit.exe*. Finally, copy the dll files from
-*src/win32gtk/bin/* to the directory containing the Textadept executables.
+*../textadept.exe*. Finally, copy the dll files from *src/win32gtk/bin/* to the
+directory containing the Textadept executables.
Similarly for the terminal version, run `make win32-curses` or its variant as
-suggested above to build *../textadept-curses.exe* and
-*../textadeptjit-curses.exe*.
-
-Please note the build process produces a *lua51.dll* for _only_
-*textadeptjit.exe* and *textadeptjit-curses.exe* because limitations on external
-Lua library loading do not allow statically linking LuaJIT to Textadept.
+suggested above to build *../textadept-curses.exe*.
### Cross Compiling for Mac OSX
When cross-compiling from within Linux, run `make osx-deps` to prepare the build
-environment followed by `make osx` to build *../textadept.osx* and
-*../textadeptjit.osx*.
+environment followed by `make osx` to build *../textadept.osx*.
-Similarly, `make osx-curses` builds *../textadept-curses.osx* and
-*../textadeptjit-curses.osx*.
+Similarly, `make osx-curses` builds *../textadept-curses.osx*.
Build a new *Textadept.app* with `make osx-app`.
@@ -1777,8 +1736,7 @@ Note that the entire compiling process can easily take 30 minutes or more and
ultimately consume nearly 1GB of disk space.
After using *jhbuild*, GTK+ is in *~/gtk/* so make a symlink from *~/gtk/inst*
-to *src/gtkosx* in Textadept. Then run `make osx` to build *../textadept.osx*
-and *../textadeptjit.osx*.
+to *src/gtkosx* in Textadept. Then run `make osx` to build *../textadept.osx*.
Developer note: in order to build a GTK+ for OSX bundle, run the following from
the *src/* directory before zipping up *gtkosx/include/* and *gtkosx/lib/*:
@@ -1789,22 +1747,11 @@ the *src/* directory before zipping up *gtkosx/include/* and *gtkosx/lib/*:
where `username` is your username.
Compiling the terminal version is not so expensive and requires no additional
-libraries. Simply run `make osx-curses` to build *../textadept-curses.osx* and
-*../textadeptjit-curses.osx*.
+libraries. Simply run `make osx-curses` to build *../textadept-curses.osx*.
[XCode]: http://developer.apple.com/TOOLS/xcode/
[jhbuild]: https://wiki.gnome.org/Projects/GTK+/OSX/Building
-### Notes on LuaJIT
-
-[LuaJIT][] is a Just-In-Time Compiler for Lua and can boost the speed of Lua
-programs. LuaJIT offers no real benefit performance-wise to justify it being
-Textadept's default runtime. LuaJIT's [ffi library][], however, appears to be
-useful for interfacing with external, non-Lua, libraries.
-
-[LuaJIT]: http://luajit.org
-[ffi library]: http://luajit.org/ext_ffi.html
-
### Notes on CDK
[CDK][] is a library of curses widgets. The terminal version of Textadept
@@ -2105,6 +2052,16 @@ instead of [TRE][].
[TRE]: https://github.com/laurikari/tre
+#### Mac OSX System Requirements
+
+Textadept now requires Mac OSX 10.6 (Snow Leopard) at a minimum. The previous
+minimum version was 10.5 (Leopard).
+
+#### LuaJIT Changes
+
+The LuaJIT version of Textadept has been removed. Any LuaJIT-specific features
+used in external modules will no longer function.
+
### Textadept 8 to 9
Textadept 9 introduces minor API changes (mostly renames of existing functions
diff --git a/init.lua b/init.lua
index b5f46760..57d63c1d 100644
--- a/init.lua
+++ b/init.lua
@@ -79,8 +79,6 @@ end
local buffer = buffer
buffer:set_theme(not CURSES and 'light' or 'term')
-buffer.FIND_REGEXP = buffer.FIND_REGEXP + buffer.FIND_CXX11REGEX
-
-- Multiple Selection and Virtual Space
buffer.multiple_selection = true
buffer.additional_selection_typing = true
@@ -301,12 +299,11 @@ events.connect(events.VIEW_NEW, function()
}
local ctrl_shift_keys = {'L', 'T', 'U', 'Z'}
for i = 1, #ctrl_keys do
- buffer:clear_cmd_key(string.byte(ctrl_keys[i]) +
- bit32.lshift(buffer.MOD_CTRL, 16))
+ buffer:clear_cmd_key(string.byte(ctrl_keys[i]) | buffer.MOD_CTRL << 16)
end
for i = 1, #ctrl_shift_keys do
- buffer:clear_cmd_key(string.byte(ctrl_shift_keys[i]) +
- bit32.lshift(buffer.MOD_CTRL + buffer.MOD_SHIFT, 16))
+ buffer:clear_cmd_key(string.byte(ctrl_shift_keys[i]) |
+ (buffer.MOD_CTRL | buffer.MOD_SHIFT) << 16)
end
-- Since BUFFER_NEW loads themes and settings on startup, only load them for
-- subsequent views.
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 3e000f18..429b658f 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -24,8 +24,9 @@ function M.toggle(on, line)
if not line then line = buffer:line_from_position(buffer.current_pos) end
local f = on and buffer.marker_add or buffer.marker_delete
if on == nil then -- toggle
- local bit, marker_mask = 2^M.MARK_BOOKMARK, buffer:marker_get(line)
- if bit32.band(marker_mask, bit) == 0 then f = buffer.marker_add end
+ if buffer:marker_get(line) & 1 << M.MARK_BOOKMARK == 0 then
+ f = buffer.marker_add
+ end
end
f(buffer, line, M.MARK_BOOKMARK)
end
@@ -58,12 +59,12 @@ function M.goto_mark(next)
if buffer.filename then
basename = basename:iconv('UTF-8', _CHARSET)
end
- local line = buffer:marker_next(0, 2^M.MARK_BOOKMARK)
+ local line = buffer:marker_next(0, 1 << M.MARK_BOOKMARK)
while line >= 0 do
local mark = string.format('%s:%d: %s', basename, line + 1,
buffer:get_line(line):match('^[^\r\n]*'))
utf8_list[#utf8_list + 1], buffers[#utf8_list + 1] = mark, buffer
- line = buffer:marker_next(line + 1, 2^M.MARK_BOOKMARK)
+ line = buffer:marker_next(line + 1, 1 << M.MARK_BOOKMARK)
end
end
end
@@ -78,9 +79,10 @@ function M.goto_mark(next)
else
local f = next and buffer.marker_next or buffer.marker_previous
local current_line = buffer:line_from_position(buffer.current_pos)
- local line = f(buffer, current_line + (next and 1 or -1), 2^M.MARK_BOOKMARK)
+ local line = f(buffer, current_line + (next and 1 or -1),
+ 1 << M.MARK_BOOKMARK)
if line == -1 then
- line = f(buffer, (next and 0 or buffer.line_count), 2^M.MARK_BOOKMARK)
+ line = f(buffer, (next and 0 or buffer.line_count), 1 << M.MARK_BOOKMARK)
end
if line >= 0 then textadept.editing.goto_line(line) end
end
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index b66df48f..26f53449 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -147,7 +147,7 @@ end)
-- Highlights matching braces.
events.connect(events.UPDATE_UI, function(updated)
- if updated and bit32.band(updated, 3) == 0 then return end -- ignore scrolling
+ if updated and updated & 3 == 0 then return end -- ignore scrolling
if M.brace_matches[buffer.char_at[buffer.current_pos]] then
local match = buffer:brace_match(buffer.current_pos, 0)
if match ~= -1 then
@@ -268,8 +268,8 @@ function M.paste()
end
local indentation = buffer:text_range(buffer:position_from_line(i),
buffer.line_indent_position[i])
- local fold_header = i ~= line and bit32.band(buffer.fold_level[i],
- buffer.FOLDLEVELHEADERFLAG) > 0
+ local fold_header = i ~= line and
+ buffer.fold_level[i] & buffer.FOLDLEVELHEADERFLAG > 0
if fold_header then
indentation = indentation..(buffer.use_tabs and '\t' or
string.rep(' ', buffer.tab_width))
@@ -512,8 +512,7 @@ function M.convert_indentation()
local e = buffer.line_indent_position[line]
local current_indentation, new_indentation = buffer:text_range(s, e), nil
if buffer.use_tabs then
- -- Need integer division and LuaJIT does not have // operator.
- local tabs = math.floor(indent / buffer.tab_width)
+ local tabs = indent // buffer.tab_width
local spaces = math.fmod(indent, buffer.tab_width)
new_indentation = string.rep('\t', tabs)..string.rep(' ', spaces)
else
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 1ae75ae0..c81e3aa4 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -361,11 +361,11 @@ function M.goto_error(line, next)
if not line and next ~= nil then
local f = buffer['marker_'..(next and 'next' or 'previous')]
line = buffer:line_from_position(buffer.current_pos)
- local wline = f(buffer, line + (next and 1 or -1), 2^M.MARK_WARNING)
- local eline = f(buffer, line + (next and 1 or -1), 2^M.MARK_ERROR)
+ local wline = f(buffer, line + (next and 1 or -1), 1 << M.MARK_WARNING)
+ local eline = f(buffer, line + (next and 1 or -1), 1 << M.MARK_ERROR)
if wline == -1 and eline == -1 then
- wline = f(buffer, next and 0 or buffer.line_count, 2^M.MARK_WARNING)
- eline = f(buffer, next and 0 or buffer.line_count, 2^M.MARK_ERROR)
+ wline = f(buffer, next and 0 or buffer.line_count, 1 << M.MARK_WARNING)
+ eline = f(buffer, next and 0 or buffer.line_count, 1 << M.MARK_ERROR)
elseif wline == -1 or eline == -1 then
if wline == -1 then wline = eline else eline = wline end
end
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index c4bc4f3d..18ab1851 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -144,10 +144,11 @@ function M.save(filename)
filename)
-- Write out bookmarks.
local lines = {}
- local line = buffer:marker_next(0, 2^textadept.bookmarks.MARK_BOOKMARK)
+ local line = buffer:marker_next(0, 1 << textadept.bookmarks.MARK_BOOKMARK)
while line >= 0 do
lines[#lines + 1] = line
- line = buffer:marker_next(line + 1, 2^textadept.bookmarks.MARK_BOOKMARK)
+ line = buffer:marker_next(line + 1,
+ 1 << textadept.bookmarks.MARK_BOOKMARK)
end
session[#session + 1] = 'bookmarks: '..table.concat(lines, ' ')
end
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index 3685f1a2..698afa38 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -164,8 +164,8 @@ local function new_snippet(text, trigger)
-- snippet. (If so, pos will point to the correct position.)
local pos = buffer:indicator_end(INDIC_CURRENTPLACEHOLDER, self.start_pos)
if pos == 0 then pos = self.start_pos end
- return bit32.band(buffer:indicator_all_on_for(pos),
- 2^INDIC_CURRENTPLACEHOLDER) > 0 and pos + 1 or pos
+ return buffer:indicator_all_on_for(pos) &
+ 1 << INDIC_CURRENTPLACEHOLDER > 0 and pos + 1 or pos
else
return M._snippet_mt[k]
end
@@ -184,8 +184,7 @@ local function new_snippet(text, trigger)
if #lines > 1 then
-- Match indentation on all lines after the first.
local line = buffer:line_from_position(buffer.current_pos)
- -- Need integer division and LuaJIT does not have // operator.
- local level = math.floor(buffer.line_indentation[line] / buffer.tab_width)
+ local level = buffer.line_indentation[line] // buffer.tab_width
local additional_indent = indent[use_tabs]:rep(level)
for i = 2, #lines do lines[i] = additional_indent..lines[i] end
end
@@ -543,8 +542,7 @@ M._snippet_mt = {
return function()
local s = buffer:indicator_end(M.INDIC_PLACEHOLDER, i)
while s > 0 and s <= self.end_pos do
- if bit32.band(buffer:indicator_all_on_for(i),
- 2^M.INDIC_PLACEHOLDER) > 0 then
+ if buffer:indicator_all_on_for(i) & 1 << M.INDIC_PLACEHOLDER > 0 then
-- This next indicator comes directly after the previous one; adjust
-- start and end positions to compensate.
s, i = buffer:indicator_start(M.INDIC_PLACEHOLDER, i), s
@@ -617,8 +615,7 @@ M._snippet_mt = {
-- Update snippet transforms when text is added or deleted.
events.connect(events.UPDATE_UI, function(updated)
- if #snippet_stack > 0 and updated and
- bit32.band(updated, buffer.UPDATE_CONTENT) > 0 then
+ if #snippet_stack > 0 and updated and updated & buffer.UPDATE_CONTENT > 0 then
snippet_stack[#snippet_stack]:update_transforms()
end
end)
diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua
index d7294b1a..0d407f9b 100755
--- a/scripts/gen_iface.lua
+++ b/scripts/gen_iface.lua
@@ -27,7 +27,7 @@ for line in io.lines('../src/scintilla/include/Scintilla.iface') do
for i = 1, #ignores do if name:find(ignores[i]) then goto continue end end
name = name:gsub('^SC_', ''):gsub('^SC([^N]%u+)', '%1')
if name == 'FIND_REGEXP' then
- value = tostring(tonumber(value) + 2^22) -- add SCFIND_POSIX
+ value = tostring(tonumber(value) + 2^23) -- add SCFIND_CXX11REGEX
elseif name == 'MASK_FOLDERS' then
value = '-33554432'
end
diff --git a/scripts/osx/textadept_osx b/scripts/osx/textadept_osx
index 5575c9a0..76edf9e8 100755
--- a/scripts/osx/textadept_osx
+++ b/scripts/osx/textadept_osx
@@ -23,6 +23,4 @@ if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then shift 1; fi
if [ -f $HOME/.textadept/osx_env.sh ]; then . $HOME/.textadept/osx_env.sh; fi
# Run Textadept.
-textadept=textadept
-if [ ! -z $TEXTADEPTJIT ]; then textadept=textadeptjit; fi
-exec "$bundle/Contents/MacOS/$textadept" "$@"
+exec "$bundle/Contents/MacOS/textadept" "$@"
diff --git a/src/Makefile b/src/Makefile
index 4941a1b0..c370ffc7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -34,14 +34,13 @@ ifeq (win, $(findstring win, $(MAKECMDGOALS)))
CURSES_CFLAGS = -DLIBICONV_STATIC -Iwin32curses/include
CURSES_LIBS = win32curses/lib/pdcurses.a win32curses/lib/libiconv.a
endif
- libluajit = luajit/src/lua51.dll
else ifeq (osx, $(findstring osx, $(MAKECMDGOALS)))
# Cross-compile for Mac OSX.
CROSS = x86_64-apple-darwin9-
CFLAGS += -mdynamic-no-pic
CXXFLAGS += -mdynamic-no-pic
LUA_CFLAGS = -DLUA_USE_MACOSX
- LDFLAGS = -liconv -Wl,-read_only_relocs,suppress
+ LDFLAGS = -liconv
ifeq (, $(findstring curses, $(MAKECMDGOALS)))
plat_flag = -DGTK
GTK_CFLAGS = $(shell PKG_CONFIG_PATH=`pwd`/gtkosx/lib/pkgconfig \
@@ -58,7 +57,6 @@ else ifeq (osx, $(findstring osx, $(MAKECMDGOALS)))
plat_flag = -DCURSES
CURSES_LIBS = -lncurses
endif
- libluajit = luajit/src/libluajit.osx.a
else
# Build for Linux/BSD.
LUA_CFLAGS = -DLUA_USE_LINUX
@@ -88,7 +86,7 @@ else
GTK_LIBS = $(shell pkg-config --libs gtk+-3.0 gmodule-2.0)
endif
GLIB_CFLAGS = $(shell pkg-config --cflags glib-2.0)
- install_targets = ../textadept ../textadeptjit
+ install_targets = ../textadept
else
plat_flag = -DCURSES
CURSES_CFLAGS = $(shell pkg-config --silence-errors --cflags ncursesw || \
@@ -98,9 +96,8 @@ else
pkg-config --silence-errors --libs ncurses || \
pkg-config --silence-errors --libs curses || \
echo -lncursesw)
- install_targets = ../textadept-curses ../textadeptjit-curses
+ install_targets = ../textadept-curses
endif
- libluajit = luajit/src/libluajit.a
endif
# Scintilla.
@@ -117,7 +114,7 @@ sci_objs = AutoComplete.o CallTip.o CaseConvert.o CaseFolder.o Catalogue.o \
sci_lex_objs = Accessor.o CharacterCategory.o CharacterSet.o LexerBase.o \
LexerModule.o LexerNoExceptions.o LexerSimple.o PropSetSimple.o \
StyleContext.o WordList.o
-sci_lexer_objs = LexLPeg.o LexLPegjit.o LexLPeg-curses.o LexLPegjit-curses.o
+sci_lexer_objs = LexLPeg.o LexLPeg-curses.o
sci_gtk_objs = PlatGTK.o ScintillaGTK.o ScintillaGTKAccessible.o
sci_curses_objs = ScintillaCurses.o
@@ -125,8 +122,8 @@ sci_curses_objs = ScintillaCurses.o
ta_flags = -std=c99 -pedantic $(plat_flag) -Iscintilla/include -Igtdialog -Wall
-textadept_gtk_objs = textadept.o textadeptjit.o
-textadept_curses_objs = textadept-curses.o textadeptjit-curses.o
+textadept_gtk_objs = textadept.o
+textadept_curses_objs = textadept-curses.o
textadept_objs = $(textadept_gtk_objs) $(textadept_curses_objs)
lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \
linit.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o \
@@ -134,9 +131,7 @@ lua_objs = lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o \
lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o
lua_lib_objs = lpcap.o lpcode.o lpprint.o lptree.o lpvm.o lfs.o
-luajit_lib_objs = lpcapjit.o lpcodejit.o lpprintjit.o lptreejit.o lpvmjit.o \
- lfsjit.o lutf8libjit.o
-lua_spawn_objs = lspawn.o lspawnjit.o lspawn-curses.o lspawnjit-curses.o
+lua_spawn_objs = lspawn.o lspawn-curses.o
gtdialog_objs = gtdialog.o gtdialog-curses.o
termkey_unix_objs = driver-ti.o driver-csi.o
termkey_win32_objs = driver-win32-pdcurses.o
@@ -154,12 +149,12 @@ endif
# Build.
-all: textadept textadeptjit
-curses: textadept-curses textadeptjit-curses
-win32: textadept.exe textadeptjit.exe
-win32-curses: textadept-curses.exe textadeptjit-curses.exe
-osx: textadept textadeptjit
-osx-curses: textadept-curses textadeptjit-curses
+all: textadept
+curses: textadept-curses
+win32: textadept.exe
+win32-curses: textadept-curses.exe
+osx: textadept
+osx-curses: textadept-curses
$(sci_objs): %.o: scintilla/src/%.cxx
$(CROSS)$(CXX) -c $(CXXFLAGS) $(sci_flags) $< -o $@
@@ -179,17 +174,9 @@ $(lua_objs): %.o: lua/src/%.c
$(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -ULUA_LIB $< -o $@
$(lua_lib_objs): %.o: lua/src/lib/%.c
$(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $< -o $@
-$(luajit_lib_objs): %jit.o: lua/src/lib/%.c
- $(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) $< -o $@
$(lua_spawn_objs): lua/src/lib/lspawn.c
$(CROSS)$(CC) -c $(CFLAGS) $(LUA_CFLAGS) -std=c99 -pedantic $(spawn_flags) \
$< -o $@
-luajit/src/libluajit.a: ; $(MAKE) -C luajit CC="$(CC)" CFLAGS="$(CFLAGS)"
-luajit/src/lua51.dll:
- $(MAKE) -C luajit HOST_CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Windows \
- TARGET_SHLDFLAGS="-static-libgcc"
-luajit/src/libluajit.osx.a:
- $(MAKE) -C luajit CROSS=$(CROSS) TARGET_SYS=Darwin LUAJIT_A=$(notdir $@)
$(gtdialog_objs): gtdialog/gtdialog.c
$(CROSS)$(CC) -c $(CFLAGS) -std=c99 -pedantic $(plat_flag) -DNOHELP \
-DLIBRARY $(gtdialog_flags) $< -o $@
@@ -202,23 +189,16 @@ textadept_rc.o: textadept.rc ; $(CROSS)$(WINDRES) $< $@
# Target-specific variables.
-LexLPeg-curses.o LexLPegjit-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS)
+LexLPeg-curses.o: sci_flags += -DCURSES $(CURSES_CFLAGS)
lua_dep_objs = LexLPeg.o LexLPeg-curses.o textadept.o textadept-curses.o \
$(lua_objs) $(lua_lib_objs) lspawn.o lspawn-curses.o
-luajit_dep_objs = LexLPegjit.o LexLPegjit-curses.o textadeptjit.o \
- textadeptjit-curses.o $(luajit_lib_objs) lspawnjit.o \
- lspawnjit-curses.o
$(lua_dep_objs): LUA_CFLAGS += -Ilua/src
-$(luajit_dep_objs): LUA_CFLAGS += -Iluajit/src
$(textadept_gtk_objs): ta_flags += $(GTK_CFLAGS)
$(textadept_curses_objs): \
ta_flags += -Iscintilla/curses -Itermkey -Icdk $(CURSES_CFLAGS)
-lspawn.o lspawnjit.o: spawn_flags = -DGTK $(GLIB_CFLAGS)
+lspawn.o: spawn_flags = -DGTK $(GLIB_CFLAGS)
gtdialog.o: gtdialog_flags += $(GTK_CFLAGS)
gtdialog-curses.o: gtdialog_flags += -Icdk $(CURSES_CFLAGS)
-# Lua 5.3 compatibility with LuaJIT.
-lbitlib.o linit.o: LUA_CFLAGS += -DLUA_COMPAT_BITLIB -DLUA_COMPAT_APIINTCASTS
-lutf8libjit.o: LUA_CFLAGS += -Ilua/src
# Executables.
@@ -226,41 +206,21 @@ textadept: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \
scintilla-marshal.o textadept.o $(lua_objs) $(lua_lib_objs) \
lspawn.o gtdialog.o
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
-textadeptjit: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \
- scintilla-marshal.o textadeptjit.o $(luajit_lib_objs) \
- $(libluajit) lspawnjit.o gtdialog.o
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
textadept-curses: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \
$(sci_curses_objs) textadept-curses.o $(lua_objs) \
$(lua_lib_objs) lspawn-curses.o gtdialog-curses.o termkey.o \
$(termkey_unix_objs) $(cdk_objs)
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
-textadeptjit-curses: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \
- $(sci_curses_objs) textadeptjit-curses.o \
- $(luajit_lib_objs) $(libluajit) lspawnjit-curses.o \
- gtdialog-curses.o termkey.o $(termkey_unix_objs) \
- $(cdk_objs)
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
textadept.exe: $(sci_objs) $(sci_lex_objs) LexLPeg.o $(sci_gtk_objs) \
scintilla-marshal.o textadept.o textadept_rc.o $(lua_objs) \
$(lua_lib_objs) lspawn.o gtdialog.o
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
-textadeptjit.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit.o $(sci_gtk_objs) \
- scintilla-marshal.o textadeptjit.o textadept_rc.o \
- $(luajit_lib_objs) $(libluajit) lspawnjit.o gtdialog.o
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(GTK_LIBS) $(LDFLAGS)
textadept-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPeg-curses.o \
$(sci_curses_objs) textadept-curses.o textadept_rc.o \
$(lua_objs) $(lua_lib_objs) lspawn-curses.o \
gtdialog-curses.o termkey.o $(termkey_win32_objs) \
$(cdk_objs)
$(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
-textadeptjit-curses.exe: $(sci_objs) $(sci_lex_objs) LexLPegjit-curses.o \
- $(sci_curses_objs) textadeptjit-curses.o \
- textadept_rc.o $(luajit_lib_objs) $(libluajit) \
- lspawnjit-curses.o gtdialog-curses.o termkey.o \
- $(termkey_win32_objs) $(cdk_objs)
- $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(CURSES_LIBS) $(LDFLAGS)
# Install/uninstall.
@@ -289,9 +249,7 @@ uninstall:
# Clean.
-clean:
- $(MAKE) CC=$(CC) -C luajit clean
- rm -f *.o ../textadept*
+clean: ; rm -f *.o ../textadept*
# Documentation.
@@ -338,7 +296,7 @@ release: $(basedir).i386
tar czf /tmp/$<.tgz $< && rm -rf $< && gpg -ab /tmp/$<.tgz
$(basedir).x86_64: ; hg archive $@ -X ".hg*"
release64: $(basedir).x86_64
- make clean libluajit64
+ make clean
PKG_CONFIG_PATH=/opt/gtk64/lib/pkgconfig make -j4 CFLAGS="$(CFLAGS) -m64" \
CXXFLAGS="$(CXXFLAGS) -m64 -static-libstdc++" || return 0
make -j4 CFLAGS="$(CFLAGS) -m64" \
@@ -355,12 +313,12 @@ win32-release: $(basedir).win32
rm -r $</lib/*.a $</lib/glib-2.0 $</lib/gtk-2.0/include $</lib/pkgconfig
make -j4 win32
make -j4 win32-curses
- cp -rL ../doc ../lexers ../textadept* luajit/src/lua51.dll $<
+ cp -rL ../doc ../lexers ../textadept* $<
cp *.asc $</src
zip -r /tmp/$<.zip $< && rm -rf $< && gpg -ab /tmp/$<.zip
$(basedir).osx: ; mkdir $@ && cp ../scripts/osx/ta $@
osx-release: $(basedir).osx
- make clean osx-deps libluajitosx
+ make clean osx-deps
make -j4 osx
make -j4 osx-curses
make osx-app && mv $(osxapp) $<
@@ -371,8 +329,7 @@ $(basedir).modules:
modules-release: $(basedir).modules
zip -r /tmp/$<.zip $< && rm -r $< && gpg -ab /tmp/$<.zip
-osx-app: ../textadept ../textadeptjit ../textadept-curses \
- ../textadeptjit-curses ../scripts/osx/textadept_osx
+osx-app: ../textadept ../textadept-curses ../scripts/osx/textadept_osx
mkdir -p $(osxapp_bin) $(osxapp_res)
cp Info.plist $(osxapp_bin)/../
cp $^ $(osxapp_bin)/
@@ -386,7 +343,7 @@ osx-app: ../textadept ../textadeptjit ../textadept-curses \
# External dependencies.
-base_deps = scintilla ../lexers lua lualibs luajit gtdialog cdk ../doc/bombay
+base_deps = scintilla ../lexers lua lualibs gtdialog cdk ../doc/bombay
deps: $(base_deps) termkey
win32-deps: $(base_deps) win32gtk win32curses
osx-deps: $(base_deps) gtkosx termkey
@@ -406,11 +363,6 @@ lua_tgz = lua-5.3.4.tar.gz
lpeg_tgz = lpeg-1.0.0.tar.gz
lfs_zip = v_1_6_3.zip
lspawn_zip = 9a8b4b5e4137.zip
-luajit_tgz = LuaJIT-2.0.3.tar.gz
-# Needed since LuaJIT will not cross-compile from x86 to x64 due to pointer size
-# mismatch.
-libluajit_tgz = libluajit_2.0.3.x86_64.tgz
-libluajit_osx_tgz = libluajit_2.0.3.osx.tgz
gtdialog_zip = 6435a42450c7.zip
cdk_tgz = cdk-5.0-20150928.tgz
termkey_tgz = libtermkey-0.20.tar.gz
@@ -444,24 +396,12 @@ lua: lua.patch | $(lua_tgz)
lualibs: lua/src/lib/lpeg lua/src/lib/lfs lua/src/lib/lspawn
lua/src/lib/lpeg: | $(lpeg_tgz)
mkdir -p $@ && tar xzf $| -C $@ && mv $@/*/*.c $@/*/*.h $(dir $@)
-lua/src/lib/lfs: lfs.patch | $(lfs_zip)
+lua/src/lib/lfs: | $(lfs_zip)
if [ -d $@ ]; then rm -r $@; fi
mkdir -p $@ && unzip -d $@ $| && mv $@/*/src/*.c $@/*/src/*.h $(dir $@)
patch -d $(dir $@) -N -p1 < $<
lua/src/lib/lspawn: | $(lspawn_zip)
mkdir -p $@ && unzip -d $@ $| && mv $@/*/*.c $(dir $@)
-lua/src/lib/lutf8lib.c: lutf8libjit.patch
- cp lua/src/$(notdir $@) $@
- patch -d $(dir $@) -N -p1 < $<
-$(luajit_tgz): ; wget http://luajit.org/download/$@
-luajit: luajit.patch | $(luajit_tgz)
- if [ -d $@ ]; then rm -r $@; fi
- mkdir $@ && tar xzf $| -C $@ && mv $@/*/* $@
- patch -d $@ -N -p1 < $<
-$(libluajit_tgz): ; wget http://foicica.com/textadept/download/$@
-libluajit64: | $(libluajit_tgz) ; tar xzf $|
-$(libluajit_osx_tgz): ; wget http://foicica.com/textadept/download/$@
-libluajitosx: | $(libluajit_osx_tgz) ; tar xzf $|
$(gtdialog_zip): ; wget $(gtdialog_url) -O $@
gtdialog: | $(gtdialog_zip) ; mkdir $@ && unzip -d $@ $| && mv $@/*/* $@
$(cdk_tgz): ; wget http://invisible-mirror.net/archives/cdk/$@
@@ -504,17 +444,16 @@ $(bombay_zip): ; wget http://foicica.com/hg/bombay/archive/tip.zip -O $@
mv $(notdir $@)/*/* $(dir $@)
$(cloc): ; wget http://prdownloads.sourceforge.net/cloc/$@ -O $@
sign-deps: | $(scintilla_tgz) $(lua_tgz) $(lpeg_tgz) $(lfs_zip) $(lspawn_zip) \
- $(luajit_tgz) $(libluajit_tgz) $(gtdialog_zip) $(cdk_tgz) \
- $(termkey_tgz) $(win32gtk_zip) $(win32iconv_bin_zip) \
- $(win32iconv_lib_zip) $(win32curses_zip) $(pdcurses_zip) \
- $(gtkosx_tgz)
+ $(gtdialog_zip) $(cdk_tgz) $(termkey_tgz) $(win32gtk_zip) \
+ $(win32iconv_bin_zip) $(win32iconv_lib_zip) $(win32curses_zip) \
+ $(pdcurses_zip) $(gtkosx_tgz)
@for file in $|; do gpg -ab $$file; done
verify-deps: | $(wildcard $(basename $(wildcard *.asc)))
@for file in $|; do echo "$$file"; gpg --verify $$file.asc || return 1; done
clean-deps:
- rm -rf scintilla ../lexers lua luajit gtdialog cdk termkey win32gtk \
- win32curses gtkosx $(notdir ../doc/bombay)
+ rm -rf scintilla ../lexers lua gtdialog cdk termkey win32gtk win32curses \
+ gtkosx $(notdir ../doc/bombay)
# Count lines of code and generate ctags.
diff --git a/src/lfs.patch b/src/lfs.patch
deleted file mode 100644
index 85391e65..00000000
--- a/src/lfs.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- lfs.c 2015-04-18 10:36:56.458722799 -0400
-+++ lib/lfs.c 2015-04-18 10:37:06.806736918 -0400
-@@ -78,7 +78,7 @@
- #endif
-
- #if LUA_VERSION_NUM < 502
--# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
-+# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,LFS_LIBNAME,l))
- #endif
-
- /* Define 'strerror' for systems that do not implement it */
diff --git a/src/lua.sym b/src/lua.sym
index 3927da21..0e2914d3 100644
--- a/src/lua.sym
+++ b/src/lua.sym
@@ -147,29 +147,3 @@ luaopen_package
luaopen_string
luaopen_table
luaopen_utf8
-# LuaJIT symbols to retain that are not listed above.
-lua_call
-lua_cpcall
-lua_equal
-lua_getfenv
-lua_insert
-lua_lessthan
-lua_loadx
-lua_objlen
-lua_pcall
-lua_remove
-lua_replace
-lua_setfenv
-lua_setlevel
-lua_tointeger
-lua_tonumber
-lua_yield
-luaL_findtable
-luaL_loadbuffer
-luaL_loadfile
-luaL_prepbuffer
-luaL_register
-luaL_typerror
-luaopen_bit
-luaopen_ffi
-luaopen_jit
diff --git a/src/luajit.patch b/src/luajit.patch
deleted file mode 100644
index 3f467d36..00000000
--- a/src/luajit.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -r a7133e1798ac src/Makefile
---- a/src/Makefile Thu Jun 13 08:39:50 2013 -0400
-+++ b/src/Makefile Thu Jun 13 08:43:22 2013 -0400
-@@ -100,7 +100,7 @@
- # enabled by default. Some other features that *might* break some existing
- # code (e.g. __pairs or os.execute() return values) can be enabled here.
- # Note: this does not provide full compatibility with Lua 5.2 at this time.
--#XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT
-+XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT
- #
- # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.
- #XCFLAGS+= -DLUAJIT_DISABLE_JIT
-diff -r 509ca9567f6f src/luaconf.h
---- a/src/luaconf.h Wed Mar 19 23:15:13 2014 -0400
-+++ b/src/luaconf.h Wed Mar 19 23:22:19 2014 -0400
-@@ -21,9 +21,9 @@
- #define LUA_LDIR "!\\lua\\"
- #define LUA_CDIR "!\\"
- #define LUA_PATH_DEFAULT \
-- ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
-+ LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
- #define LUA_CPATH_DEFAULT \
-- ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
-+ LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
- #else
- /*
- ** Note to distribution maintainers: do NOT patch the following lines!
-@@ -35,7 +35,7 @@
- #ifndef LUA_LMULTILIB
- #define LUA_LMULTILIB "lib"
- #endif
--#define LUA_LROOT "/usr/local"
-+#define LUA_LROOT "/usr/"
- #define LUA_LUADIR "/lua/5.1/"
- #define LUA_LJDIR "/luajit-2.0.3/"
-
-@@ -51,20 +51,20 @@
- #define LUA_RCPATH
- #endif
-
--#define LUA_JPATH ";" LUA_JROOT "/share" LUA_LJDIR "?.lua"
-+#define LUA_JPATH LUA_JROOT "/share" LUA_LJDIR "?.lua"
- #define LUA_LLDIR LUA_LROOT "/share" LUA_LUADIR
- #define LUA_LCDIR LUA_LROOT "/" LUA_LMULTILIB LUA_LUADIR
- #define LUA_LLPATH ";" LUA_LLDIR "?.lua;" LUA_LLDIR "?/init.lua"
--#define LUA_LCPATH1 ";" LUA_LCDIR "?.so"
-+#define LUA_LCPATH1 LUA_LCDIR "?.so"
- #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so"
-
--#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH
--#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
-+#define LUA_PATH_DEFAULT LUA_JPATH LUA_LLPATH LUA_RLPATH
-+#define LUA_CPATH_DEFAULT LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
- #endif
-
- /* Environment variable names for path overrides and initialization code. */
--#define LUA_PATH "LUA_PATH"
--#define LUA_CPATH "LUA_CPATH"
-+#define LUA_PATH "TA_LUA_PATH"
-+#define LUA_CPATH "TA_LUA_CPATH"
- #define LUA_INIT "LUA_INIT"
-
- /* Special file system characters. */
diff --git a/src/lutf8libjit.patch b/src/lutf8libjit.patch
deleted file mode 100644
index 7910596d..00000000
--- a/src/lutf8libjit.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- lutf8lib.c 2015-01-12 18:46:22.334838510 -0500
-+++ lib/lutf8lib.c 2015-01-12 22:42:54.527406794 -0500
-@@ -246,8 +246,9 @@
- };
-
-
--LUAMOD_API int luaopen_utf8 (lua_State *L) {
-- luaL_newlib(L, funcs);
-+int luaopen_utf8 (lua_State *L) {
-+ lua_newtable(L), luaL_register(L, "utf8", funcs);
-+ lua_pushvalue(L, -1), lua_setglobal(L, "utf8");
- lua_pushlstring(L, UTF8PATT, sizeof(UTF8PATT)/sizeof(char) - 1);
- lua_setfield(L, -2, "charpattern");
- return 1;
diff --git a/src/textadept.c b/src/textadept.c
index e077e983..3433a149 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -104,24 +104,7 @@ typedef void Scintilla;
l_setcfunction(l, -1, "__newindex", __newindex); \
} \
lua_setmetatable(l, (n > 0) ? n : n - 1);
-// Translate Lua 5.3 API to LuaJIT API (Lua 5.1) for compatibility.
-#if LUA_VERSION_NUM == 501
-#define LUA_OK 0
-#define lua_rawlen lua_objlen
-#define LUA_OPEQ 0
-#undef lua_getglobal
-#define lua_getglobal(l, n) \
- (lua_getfield(l, LUA_GLOBALSINDEX, (n)), lua_type(l, -1))
-#define lua_getfield(l, t, k) (lua_getfield(l, t, k), lua_type(l, -1))
-#define lua_rawgeti(l, i, n) (lua_rawgeti(l, i, n), lua_type(l, -1))
-#define lua_gettable(l, i) (lua_gettable(l, i), lua_type(l, -1))
-#define luaL_openlibs(l) luaL_openlibs(l), luaopen_utf8(l)
-#define lL_openlib(l, n) \
- (lua_pushcfunction(l, luaopen_##n), lua_pushstring(l, #n), lua_call(l, 1, 0))
-LUALIB_API int luaopen_utf8(lua_State *);
-#else
#define lL_openlib(l, n) (luaL_requiref(l, #n, luaopen_##n, 1), lua_pop(l, 1))
-#endif
static char *textadept_home, *platform;
@@ -1513,13 +1496,9 @@ static int lL_init(lua_State *L, int argc, char **argv, int reinit) {
lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
lL_cleartable(L, lua_gettop(L));
lua_pop(L, 1); // _LOADED
-#if LUA_VERSION_NUM >= 502
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
lL_cleartable(L, lua_gettop(L));
lua_pop(L, 1); // _G
-#else
- lL_cleartable(L, LUA_GLOBALSINDEX);
-#endif
}
lua_pushinteger(L, (sptr_t)L), lua_setglobal(L, "_LUA");
luaL_openlibs(L);