Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
Originally the error message was displayed in Textadept, but any attempts to
close the program would fail because core/init.lua wasn't properly loaded.
Errors from 'l_load_script' are displayed in a dialog box now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The l_init function takes an additional reinit boolean as a result.
When resetting, the package.loaded and _G tables are cleared. Since the
textadept.buffers, textadept.views, and arg tables were originally in _G, they
were moved to the LUA_REGISTRYINDEX table so as not to be lost. They are still
available in _G, but as links to the tables in LUA_REGISTRYINDEX.
textadept.reset() sets a global RESETTING boolean to true when init.lua is
re-run so things like reloading a session or reloading files from the command
line do not occur. The boolean is set to nil afterwards.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Modified C++ code structure to be more consistent throughout. Also added
comments for functions that handle key events, indicating which (hard-coded)
keys trigger what actions.
|
|
Stack index argument to l_get_buffer_prop was not intuitive because it was
essentially index - 1. So after lua_getglobal(lua, "buffer"), the index arg to
l_get_buffer_prop had to be -2 because the property name is pushed onto the
stack before calling lua_rawget. Instead, l_get_bufferp subtracts 1 from the
index it is given, so -1 can be used.
|
|
Since l_check{view|docpointer} throw errors, the unprotected C functions that
call them will cause a Lua panic if either textadept.views or textadept.buffers
does not exist and Textadept will exit. This makes sense since the two tables
are integral to the application. Therefore instead of checking if either table
exists in those unprotected C functions and handling a failed check safely,
throw an error and exit Textadept anyway because sooner or later one will be
thrown from l_check{view|docpointer}.
|
|
|
|
When switching to another buffer, typing text, and switching back, the scroll
position was not restored properly all of the time. Fixed by setting the anchor
and caret first, which scrolls some number of lines, then scrolling the
remaining number of lines to restore the original scroll position.
|
|
Instead of raising errors which call Lua's textadept.handlers.error function
(which at this point in time opens a new buffer and prints the error message),
quietly print warnings to STDOUT because an error hasn't really occured.
|
|
If p1_type == tLENGTH and p2_type == tSTRINGRESULT, both parameters can be
ignored because p1_type is filled with the length of p2_type, which is not
needed.
|
|
|