diff options
-rw-r--r-- | core/file_io.lua | 274 | ||||
-rw-r--r-- | core/handlers.lua | 355 | ||||
-rw-r--r-- | core/iface.lua | 849 | ||||
-rw-r--r-- | core/init.lua | 21 |
4 files changed, 1499 insertions, 0 deletions
diff --git a/core/file_io.lua b/core/file_io.lua new file mode 100644 index 00000000..12fcc3c1 --- /dev/null +++ b/core/file_io.lua @@ -0,0 +1,274 @@ +-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE. + +--- +-- Provides file input/output routines for Textadept. +-- Opens and saves files and sessions and reads API files. +module('textadept.io', package.seeall) + +local handlers = textadept.handlers + +--- +-- [Local] Opens a file or goes to its already open buffer. +-- @param filename The absolute path to the file to open. +local function open_helper(filename) + if not filename then return end + for index, buffer in ipairs(textadept.buffers) do + if filename == buffer.filename then view:goto_buffer(index) return end + end + local buffer = textadept.new_buffer() + local f, err = io.open(filename) + if f then + buffer:set_text( f:read('*all') ) + buffer:empty_undo_buffer() + f:close() + end + buffer.filename = filename + buffer:set_save_point() + handlers.handle('file_opened', filename) +end + +--- +-- Opens a list of files. +-- @param filenames A '|' separated list of filenames to open. If none +-- specified, the user is prompted to open files from a dialog. +-- @usage textadept.io.open(filename) +function open(filenames) + if not filenames then + local directory = '--filename="'..(buffer.filename or '')..'"' + filenames = io.popen('zenity --file-selection --multiple '.. + directory):read('*all') + end + for filename in filenames:gmatch('[^|\n]+') do open_helper(filename) end +end + +--- +-- Saves the current buffer to a file. +-- @param buffer The buffer to save. Its 'filename' property is used as the +-- path of the file to save to. This must be the currently focused buffer. +-- @usage buffer:save() +function save(buffer) + textadept.check_focused_buffer(buffer) + if not buffer.filename then return save_as(buffer) end + local f, err = io.open(buffer.filename, 'w') + if f then + prepare = modules.textadept.editing.prepare_for_save + if prepare then prepare() end + local txt, _ = buffer:get_text(buffer.length) + f:write(txt) + f:close() + buffer:set_save_point() + else + handlers.error(err) + end +end + +--- +-- Saves the current buffer to a file different than its filename property. +-- @param buffer The buffer to save. This must be the currently focused buffer. +-- @filename The new filepath to save the buffer to. +-- @usage buffer:save_as(filename) +function save_as(buffer, filename) + textadept.check_focused_buffer(buffer) + if not filename then + local directory = '--filename="'..(buffer.filename or '')..'"' + filename = io.popen('zenity --file-selection --save '.. + directory..' --confirm-overwrite'):read('*all') + end + if #filename > 0 then + buffer.filename = filename:sub(1, -2) -- chomp + buffer:save() + handlers.handle('file_saved_as', filename) + end +end + +--- +-- Saves all dirty buffers to their respective files. +-- @usage textadept.io.save_all() +function save_all() + local current_buffer = buffer + local current_index + for idx, buffer in ipairs(textadept.buffers) do + view:goto_buffer(idx) + if buffer == current_buffer then current_index = idx end + if buffer.filename and buffer.dirty then buffer:save() end + end + view:goto_buffer(current_index) +end + +--- +-- Closes the current buffer. +-- If the buffer is dirty, the user is prompted to continue. The buffer is not +-- saved automatically. It must be done manually. +-- @param buffer The buffer to close. This must be the currently focused +-- buffer. +-- @usage buffer:close() +function close(buffer) + textadept.check_focused_buffer(buffer) + if buffer.dirty and os.execute('zenity --question --title Alert '.. + '--text "Close without saving?"') ~= 0 then + return false + end + buffer:delete() + return true +end + +--- +-- Closes all open buffers. +-- If any buffer is dirty, the user is prompted to continue. No buffers are +-- saved automatically. They must be saved manually. +-- @usage textadept.io.close_all() +function close_all() + while #textadept.buffers > 1 do + view:goto_buffer(#textadept.buffers) + if not buffer:close() then return end + end + buffer:close() -- the last one +end + +--- +-- Loads a Textadept session file. +-- Textadept restores split views, opened buffers, cursor information, and +-- project manager details. +-- @param filename The absolute path to the session file to load. Defaults to +-- $HOME/.ta_session if not specified. +-- @usage textadept.io.load_session(filename) +function load_session(filename) + local textadept = textadept + local f = io.open(filename or os.getenv('HOME')..'/.ta_session') + local current_view, splits = 1, { [0] = {} } + if f then + for line in f:lines() do + if line:match('^buffer:') then + local anchor, current_pos, first_visible_line, filename = + line:match('^buffer: (%d+) (%d+) (%d+) (.+)$') + textadept.io.open(filename or '') + -- Restore saved buffer selection and view. + local anchor = tonumber(anchor) or 0 + local current_pos = tonumber(current_pos) or 0 + local first_visible_line = tonumber(first_visible_line) or 0 + local buffer = buffer + buffer._anchor, buffer._current_pos = anchor, current_pos + buffer._first_visible_line = first_visible_line + buffer:line_scroll( 0, + buffer:visible_from_doc_line(first_visible_line) ) + buffer:set_sel(anchor, current_pos) + elseif line:match('^%s*split%d:') then + local level, num, type, size = + line:match('^(%s*)split(%d): (%S+) (%d+)') + local view = splits[#level] and splits[#level][ tonumber(num) ] or view + splits[#level + 1] = { view:split(type == 'true') } + splits[#level + 1][1].size = tonumber(size) -- could be 1 or 2 + elseif line:match('^%s*view%d:') then + local level, num, buf_idx = line:match('^(%s*)view(%d): (%d+)$') + local view = splits[#level][ tonumber(num) ] or view + view:goto_buffer( tonumber(buf_idx) ) + elseif line:match('^current_view:') then + local view_idx, buf_idx = line:match('^current_view: (%d+)') + current_view = tonumber(view_idx) or 1 + elseif line:match('^pm:') then + local width, text = line:match('^pm: (%d+) (.+)$') + textadept.pm.width = width or 0 + textadept.pm.entry_text = text or '' + textadept.pm.activate() + end + end + f:close() + textadept.views[current_view]:focus() + end +end + +--- +-- Saves a Textadept session to a file. +-- Saves split views, opened buffers, cursor information, and project manager +-- details. +-- @param filename The absolute path to the session file to save. Defaults to +-- $HOME/.ta_session if not specified. +-- @usage textadept.io.save_session(filename) +function save_session(filename) + local session = '' + local buffer_line = "buffer: %d %d %d %s\n" -- anchor, cursor, line, filename + local split_line = "%ssplit%d: %s %d\n" -- level, number, type, size + local view_line = "%sview%d: %d\n" -- level, number, doc index + -- Write out opened buffers. (buffer: filename) + local buffer_indices, offset = {}, 0 + for idx, buffer in ipairs(textadept.buffers) do + if buffer.filename then + local current = buffer.doc_pointer == textadept.focused_doc_pointer + local anchor = current and 'anchor' or '_anchor' + local current_pos = current and 'current_pos' or '_current_pos' + local first_visible_line = current and 'first_visible_line' or + '_first_visible_line' + session = session.. + buffer_line:format(buffer[anchor] or 0, buffer[current_pos] or 0, + buffer[first_visible_line] or 0, buffer.filename) + buffer_indices[buffer.doc_pointer] = idx - offset + else + offset = offset + 1 -- don't save untitled files in session + end + end + -- Write out split views. + local function write_split(split, level, number) + local c1, c2 = split[1], split[2] + local vertical, size = tostring(split.vertical), split.size + local spaces = (' '):rep(level) + session = session..split_line:format(spaces, number, vertical, size) + spaces = (' '):rep(level + 1) + if type(c1) == 'table' then + write_split(c1, level + 1, 1) + else + session = session..view_line:format(spaces, 1, c1) + end + if type(c2) == 'table' then + write_split(c2, level + 1, 2) + else + session = session..view_line:format(spaces, 2, c2) + end + end + local splits = textadept.get_split_table() + if type(splits) == 'table' then + write_split(splits, 0, 0) + else + session = session..view_line:format('', 1, splits) + end + -- Write out the current focused view. + local current_view = view + for idx, view in ipairs(textadept.views) do + if view == current_view then current_view = idx break end + end + session = session..("current_view: %d\n"):format(current_view) + -- Write out other things. + local pm = textadept.pm + session = session..("pm: %d %s\n"):format(pm.width, pm.entry_text) + -- Write the session. + local f = io.open(filename or os.getenv('HOME')..'/.ta_session', 'w') + if f then f:write(session) f:close() end +end + +--- +-- Reads an API file. +-- Each non-empty line in the API file is structured as follows: +-- identifier (parameters) description +-- Whitespace is optional, but can used for formatting. In description, '\\n' +-- will be interpreted as a newline (\n) character. 'Overloaded' identifiers +-- are handled appropriately. +-- @param filename The absolute path to the API file to read. +-- @param word_chars Characters considered to be word characters for +-- determining the identifier to lookup. Its contents should be in Lua +-- pattern format suitable for the character class construct. +-- @usage textadept.io.read_api_file(filename, '%w_') +function read_api_file(filename, word_chars) + local api = {} + local f = io.open(filename) + if f then + for line in f:lines() do + local func, params, desc = + line:match('(['..word_chars..']+)%s*(%b())(.*)$') + if func and params and desc then + if not api[func] then api[func] = {} end + api[func][ #api[func] + 1 ] = { params, desc } + end + end + f:close() + end + return api +end diff --git a/core/handlers.lua b/core/handlers.lua new file mode 100644 index 00000000..d981c019 --- /dev/null +++ b/core/handlers.lua @@ -0,0 +1,355 @@ +-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE. + +--- Handler module that handles Scintilla and Textadept notifications/events. +module('textadept.handlers', package.seeall) + +local handlers = textadept.handlers + +--- +-- Adds a function to a handler. +-- Every handler has a table of functions associated with it that are run when +-- the handler is called by Textadept. +-- @param handler The string handler name. +-- @param f The Lua function to add. +-- @param index Optional index to insert the handler into. +function add_function_to_handler(handler, f, index) + local plural = handler..'s' + if not handlers[plural] then handlers[plural] = {} end + local funcs = handlers[plural] + if index then + table.insert(funcs, index, f) + else + funcs[#funcs+ 1] = f + end +end + +--- +-- Calls every function added to a handler in sequence. +-- If true or false is returned by any function, the iteration ceases. +-- @param handler The string handler name. +-- @param ... Arguments to the handler. +function handle(handler, ...) + local plural = handler..'s' + if not handlers[plural] then return end + local funcs = handlers[plural] + for _, f in ipairs(funcs) do + local result = f( unpack{...} ) + if result == true or result == false then return result end + end +end + +--- +-- Reloads handlers. +-- Clears each table of handlers for each handler function and reloads this +-- module to reset to the default handlers. +function reload() + package.loaded['handlers'] = nil + for handler in pairs(handlers) do + if handlers[handler..'s'] then handlers[handler..'s'] = nil end + end + require 'handlers' +end + +-- Signals. +function buffer_new() + return handle('buffer_new') +end +function buffer_deleted() + return handle('buffer_deleted') +end +function buffer_switch() + return handle('buffer_switch') +end +function view_new() + return handle('view_new') +end +function view_switch() + return handle('view_switch') +end +function quit() + return handle('quit') +end +function keypress(code, shift, control, alt) + return handle('keypress', code, shift, control, alt) +end + +-- Scintilla notifications. +function char_added(n) + return handle( 'char_added', string.char(n.ch) ) +end +function save_point_reached() + return handle('save_point_reached') +end +function save_point_left() + return handle('save_point_left') +end +function double_click(n) + return handle('double_click', n.position, n.line) +end +function update_ui() + return handle('update_ui') +end +function macro_record(n) + return handle('macro_record', n.message, n.wParam, n.lParam) +end +function margin_click(n) + return handle('margin_click', n.margin, n.modifiers, n.position) +end +function user_list_selection(n) + return handle('user_list_selection', n.wParam, n.text) +end +function uri_dropped(n) + return handle('uri_dropped', n.text) +end +function call_tip_click(n) + return handle('call_tip_click', n.position) +end +function auto_c_selection(n) + return handle('auto_c_selection', n.lParam, n.text) +end + +--- Map of Scintilla notifications to their handlers. +local c = textadept.constants +local scnnotifications = { + [c.SCN_CHARADDED] = char_added, + [c.SCN_SAVEPOINTREACHED] = save_point_reached, + [c.SCN_SAVEPOINTLEFT] = save_point_left, + [c.SCN_DOUBLECLICK] = double_click, + [c.SCN_UPDATEUI] = update_ui, + [c.SCN_MACRORECORD] = macro_record, + [c.SCN_MARGINCLICK] = margin_click, + [c.SCN_USERLISTSELECTION] = user_list_selection, + [c.SCN_URIDROPPED] = uri_dropped, + [c.SCN_CALLTIPCLICK] = call_tip_click, + [c.SCN_AUTOCSELECTION] = auto_c_selection +} + +--- +-- Handles Scintilla notifications. +-- @param n The Scintilla notification structure as a Lua table. +function notification(n) + local f = scnnotifications[n.code] + if f then f(n) end +end + +-- Default handlers to follow. + +add_function_to_handler('char_added', + function(char) -- auto-indent on return + if char ~= '\n' then return end + local buffer = buffer + local pos = buffer.current_pos + local curr_line = buffer:line_from_position(pos) + local last_line = curr_line - 1 + while last_line >= 0 and #buffer:get_line(last_line) == 1 do + last_line = last_line - 1 + end + if last_line >= 0 then + local indentation = buffer.line_indentation[last_line] + local s = buffer.line_indent_position[curr_line] + buffer.line_indentation[curr_line] = indentation + local e = buffer.line_indent_position[curr_line] + buffer:goto_pos(pos + e - s) + end + end) + +--- +-- [Local] Sets the title of the Textadept window to the buffer's filename. +-- @param buffer The currently focused buffer. +local function set_title(buffer) + local buffer = buffer + local filename = buffer.filename or 'Untitled' + local d = buffer.dirty and ' * ' or ' - ' + textadept.title = filename:match('[^/]+$')..d..'Textadept' +end + +add_function_to_handler('save_point_reached', + function() -- changes Textadept title to show 'clean' buffer + buffer.dirty = false + set_title(buffer) + end) + +add_function_to_handler('save_point_left', + function() -- changes Textadept title to show 'dirty' buffer + buffer.dirty = true + set_title(buffer) + end) + +--- +-- [Local table] A table of (integer) brace characters with their matches. +-- @class table +-- @name _braces +local _braces = { -- () [] {} <> + [40] = 1, [91] = 1, [123] = 1, [60] = 1, + [41] = 1, [93] = 1, [125] = 1, [62] = 1, +} + +--- +-- [Local] Highlights matching/mismatched braces appropriately. +-- @param current_pos The position to match braces at. +local function match_brace(current_pos) + local buffer = buffer + if _braces[ buffer.char_at[current_pos] ] and + buffer:get_style_name( buffer.style_at[current_pos] ) == 'operator' then + local pos = buffer:brace_match(current_pos) + if pos ~= -1 then + buffer:brace_highlight(current_pos, pos) + else + buffer:brace_bad_light(current_pos) + end + return true + end + return false +end + +add_function_to_handler('update_ui', + function() -- highlights matching braces + local buffer = buffer + if not match_brace(buffer.current_pos) then buffer:brace_bad_light(-1) end + end) + +local docstatusbar_text = "Line: %d/%d Col: %d | Lexer: %s | %s | %s | %s" +add_function_to_handler('update_ui', + function() -- sets docstatusbar text + local buffer = buffer + local pos = buffer.current_pos + local line, max = buffer:line_from_position(pos) + 1, buffer.line_count + local col = buffer.column[pos] + 1 + local lexer = buffer:get_lexer_language() + local mode = buffer.overtype and 'OVR' or 'INS' + local eol = ( { 'CRLF', 'CR', 'LF' } )[buffer.eol_mode + 1] + local tabs = (buffer.use_tabs and 'Tabs:' or 'Spaces:')..buffer.indent + textadept.docstatusbar_text = + docstatusbar_text:format(line, max, col, lexer, mode, eol, tabs) + end) + +add_function_to_handler('margin_click', + function(margin, modifiers, position) -- toggles folding + local buffer = buffer + local line = buffer:line_from_position(position) + buffer:toggle_fold(line) + end) + +add_function_to_handler('buffer_new', + function() -- set additional buffer functions + local buffer, textadept = buffer, textadept + buffer.save = textadept.io.save + buffer.save_as = textadept.io.save_as + buffer.close = textadept.io.close + set_title(buffer) + end) + +add_function_to_handler('buffer_switch', + function() -- updates titlebar and statusbar + set_title(buffer) + update_ui() + end) + +add_function_to_handler('view_switch', + function() -- updates titlebar and statusbar + set_title(buffer) + update_ui() + end) + +add_function_to_handler('quit', + function() -- prompts for confirmation if any buffers are dirty; saves session + local any = false + local list = 'The following buffers are unsaved:\n\n' + for _, buffer in ipairs(textadept.buffers) do + if buffer.dirty then + list = list..(buffer.filename or 'Untitled')..'\n' + any = true + end + end + if any then + list = list..'\nQuit without saving?' + if os.execute('zenity --question --title Alert '.. + '--text "'..list..'"') ~= 0 then + return false + end + end + textadept.io.save_session() + return true + end) + + +--- +-- Shows completions for the current command_entry text. +-- Opens a new buffer (if one hasn't already been opened) for printing possible +-- completions. +-- @param command The command to complete. +function show_completions(command) + local textadept = textadept + local match_buffer, goto + if buffer.shows_completions then + match_buffer = buffer + else + for index, buffer in ipairs(textadept.buffers) do + if buffer.shows_completions then + match_buffer = index + goto = buffer.doc_pointer ~= textadept.focused_doc_pointer + elseif buffer.doc_pointer == textadept.focused_doc_pointer then + textadept.prev_buffer = index + end + end + if not match_buffer then + match_buffer = textadept.new_buffer() + match_buffer.shows_completions = true + else + if goto then view:goto(match_buffer) end + match_buffer = textadept.buffers[match_buffer] + end + end + match_buffer:clear_all() + + local substring = command:match('[%w_%.]+$') + local path, prefix = (substring or ''):match('^([%w_.]-)%.?([%w_]*)$') + local ret, tbl = pcall(loadstring('return ('..path..')')) + if not ret then tbl = getfenv(0) end + if type(tbl) ~= 'table' then return end + for k in pairs(tbl) do + if type(k) == 'string' and k:match('^'..prefix) then + match_buffer:add_text(k..'\n') + end + end + match_buffer:set_save_point() +end + +--- +-- Hides the completion buffer if it is currently focused and restores the +-- previous focused buffer (if possible). +function hide_completions() + local textadept = textadept + if buffer.shows_completions then + buffer:close() + if textadept.prev_buffer then view:goto_buffer(textadept.prev_buffer) end + end +end + +--- +-- Default error handler. +-- Opens a new buffer (if one hasn't already been opened) for printing errors. +-- @param ... Error strings. +function error(...) + local function handle_error(...) + local textadept = textadept + local error_message = table.concat( {...} , '\n' ) + local error_buffer + for index, buffer in ipairs(textadept.buffers) do + if buffer.shows_errors then + error_buffer = buffer + if buffer.doc_pointer ~= textadept.focused_doc_pointer then + view:goto_buffer(index) + end + break + end + end + if not error_buffer then + error_buffer = textadept.new_buffer() + error_buffer.shows_errors = true + end + error_buffer:append_text(error_message..'\n') + error_buffer:set_save_point() + end + pcall( handle_error, unpack{...} ) -- prevent endless loops if this errors +end diff --git a/core/iface.lua b/core/iface.lua new file mode 100644 index 00000000..2f95f41d --- /dev/null +++ b/core/iface.lua @@ -0,0 +1,849 @@ +-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE. + +textadept.constants = { + CARETSTYLE_BLOCK = 2, + CARETSTYLE_INVISIBLE = 0, + CARETSTYLE_LINE = 1, + CARET_EVEN = 0x08, + CARET_JUMPS = 0x10, + CARET_SLOP = 0x01, + CARET_STRICT = 0x04, + EDGE_BACKGROUND = 2, + EDGE_LINE = 1, + EDGE_NONE = 0, + INDIC0_MASK = 0x20, + INDIC1_MASK = 0x40, + INDIC2_MASK = 0x80, + INDICS_MASK = 0xE0, + INDIC_BOX = 6, + INDIC_CONTAINER = 8, + INDIC_DIAGONAL = 3, + INDIC_HIDDEN = 5, + INDIC_MAX = 31, + INDIC_PLAIN = 0, + INDIC_ROUNDBOX = 7, + INDIC_SQUIGGLE = 1, + INDIC_STRIKE = 4, + INDIC_TT = 2, + INVALID_POSITION = -1, + KEYWORDSET_MAX = 8, + MARKER_MAX = 31, + SCEN_CHANGE = 768, + SCEN_KILLFOCUS = 256, + SCEN_SETFOCUS = 512, + SCFIND_MATCHCASE = 4, + SCFIND_POSIX = 0x00400000, + SCFIND_REGEXP = 0x00200000, + SCFIND_WHOLEWORD = 2, + SCFIND_WORDSTART = 0x00100000, + SCI_AUTOCGETAUTOHIDE = 2119, + SCI_AUTOCGETCANCELATSTART = 2111, + SCI_AUTOCGETCHOOSESINGLE = 2114, + SCI_AUTOCGETDROPRESTOFWORD = 2271, + SCI_AUTOCGETIGNORECASE = 2116, + SCI_AUTOCGETMAXHEIGHT = 2211, + SCI_AUTOCGETMAXWIDTH = 2209, + SCI_AUTOCGETSEPARATOR = 2107, + SCI_AUTOCGETTYPESEPARATOR = 2285, + SCI_AUTOCSETAUTOHIDE = 2118, + SCI_AUTOCSETCANCELATSTART = 2110, + SCI_AUTOCSETCHOOSESINGLE = 2113, + SCI_AUTOCSETDROPRESTOFWORD = 2270, + SCI_AUTOCSETFILLUPS = 2112, + SCI_AUTOCSETIGNORECASE = 2115, + SCI_AUTOCSETMAXHEIGHT = 2210, + SCI_AUTOCSETMAXWIDTH = 2208, + SCI_AUTOCSETSEPARATOR = 2106, + SCI_AUTOCSETTYPESEPARATOR = 2286, + SCI_CALLTIPSETBACK = 2205, + SCI_CALLTIPSETFORE = 2206, + SCI_CALLTIPSETFOREHLT = 2207, + SCI_CALLTIPUSESTYLE = 2212, + SCI_GETANCHOR = 2009, + SCI_GETBACKSPACEUNINDENTS = 2263, + SCI_GETBUFFEREDDRAW = 2034, + SCI_GETCARETFORE = 2138, + SCI_GETCARETLINEBACK = 2097, + SCI_GETCARETLINEBACKALPHA = 2471, + SCI_GETCARETLINEVISIBLE = 2095, + SCI_GETCARETPERIOD = 2075, + SCI_GETCARETSTICKY = 2457, + SCI_GETCARETSTYLE = 2513, + SCI_GETCARETWIDTH = 2189, + SCI_GETCHARAT = 2007, + SCI_GETCODEPAGE = 2137, + SCI_GETCOLUMN = 2129, + SCI_GETCONTROLCHARSYMBOL = 2389, + SCI_GETCURRENTPOS = 2008, + SCI_GETCURSOR = 2387, + SCI_GETDIRECTFUNCTION = 2184, + SCI_GETDIRECTPOINTER = 2185, + SCI_GETDOCPOINTER = 2357, + SCI_GETEDGECOLOUR = 2364, + SCI_GETEDGECOLUMN = 2360, + SCI_GETEDGEMODE = 2362, + SCI_GETENDATLASTLINE = 2278, + SCI_GETENDSTYLED = 2028, + SCI_GETEOLMODE = 2030, + SCI_GETFIRSTVISIBLELINE = 2152, + SCI_GETFOCUS = 2381, + SCI_GETFOLDEXPANDED = 2230, + SCI_GETFOLDLEVEL = 2223, + SCI_GETFOLDPARENT = 2225, + SCI_GETHIGHLIGHTGUIDE = 2135, + SCI_GETHOTSPOTACTIVEUNDERLINE = 2496, + SCI_GETHOTSPOTSINGLELINE = 2497, + SCI_GETHSCROLLBAR = 2131, + SCI_GETINDENT = 2123, + SCI_GETINDENTATIONGUIDES = 2133, + SCI_GETINDICATORCURRENT = 2501, + SCI_GETINDICATORVALUE = 2503, + SCI_GETLAYOUTCACHE = 2273, + SCI_GETLENGTH = 2006, + SCI_GETLEXER = 4002, + SCI_GETLINECOUNT = 2154, + SCI_GETLINEENDPOSITION = 2136, + SCI_GETLINEINDENTATION = 2127, + SCI_GETLINEINDENTPOSITION = 2128, + SCI_GETLINESTATE = 2093, + SCI_GETLINEVISIBLE = 2228, + SCI_GETMARGINLEFT = 2156, + SCI_GETMARGINMASKN = 2245, + SCI_GETMARGINRIGHT = 2158, + SCI_GETMARGINSENSITIVEN = 2247, + SCI_GETMARGINTYPEN = 2241, + SCI_GETMARGINWIDTHN = 2243, + SCI_GETMAXLINESTATE = 2094, + SCI_GETMODEVENTMASK = 2378, + SCI_GETMODIFY = 2159, + SCI_GETMOUSEDOWNCAPTURES = 2385, + SCI_GETMOUSEDWELLTIME = 2265, + SCI_GETOVERTYPE = 2187, + SCI_GETPASTECONVERTENDINGS = 2468, + SCI_GETPOSITIONCACHE = 2515, + SCI_GETPRINTCOLOURMODE = 2149, + SCI_GETPRINTMAGNIFICATION = 2147, + SCI_GETPRINTWRAPMODE = 2407, + SCI_GETPROPERTYINT = 4010, + SCI_GETREADONLY = 2140, + SCI_GETSCROLLWIDTH = 2275, + SCI_GETSEARCHFLAGS = 2199, + SCI_GETSELALPHA = 2477, + SCI_GETSELECTIONEND = 2145, + SCI_GETSELECTIONMODE = 2423, + SCI_GETSELECTIONSTART = 2143, + SCI_GETSELEOLFILLED = 2479, + SCI_GETSTATUS = 2383, + SCI_GETSTYLEAT = 2010, + SCI_GETSTYLEBITS = 2091, + SCI_GETSTYLEBITSNEEDED = 4011, + SCI_GETTABINDENTS = 2261, + SCI_GETTABWIDTH = 2121, + SCI_GETTARGETEND = 2193, + SCI_GETTARGETSTART = 2191, + SCI_GETTEXTLENGTH = 2183, + SCI_GETTWOPHASEDRAW = 2283, + SCI_GETUNDOCOLLECTION = 2019, + SCI_GETUSEPALETTE = 2139, + SCI_GETUSETABS = 2125, + SCI_GETVIEWEOL = 2355, + SCI_GETVIEWWS = 2020, + SCI_GETVSCROLLBAR = 2281, + SCI_GETWRAPMODE = 2269, + SCI_GETWRAPSTARTINDENT = 2465, + SCI_GETWRAPVISUALFLAGS = 2461, + SCI_GETWRAPVISUALFLAGSLOCATION = 2463, + SCI_GETXOFFSET = 2398, + SCI_GETZOOM = 2374, + SCI_INDICGETFORE = 2083, + SCI_INDICGETSTYLE = 2081, + SCI_INDICGETUNDER = 2511, + SCI_INDICSETFORE = 2082, + SCI_INDICSETSTYLE = 2080, + SCI_INDICSETUNDER = 2510, + SCI_LEXER_START = 4000, + SCI_LINESONSCREEN = 2370, + SCI_OPTIONAL_START = 3000, + SCI_SELECTIONISRECTANGLE = 2372, + SCI_SETANCHOR = 2026, + SCI_SETBACKSPACEUNINDENTS = 2262, + SCI_SETBUFFEREDDRAW = 2035, + SCI_SETCARETFORE = 2069, + SCI_SETCARETLINEBACK = 2098, + SCI_SETCARETLINEBACKALPHA = 2470, + SCI_SETCARETLINEVISIBLE = 2096, + SCI_SETCARETPERIOD = 2076, + SCI_SETCARETSTICKY = 2458, + SCI_SETCARETSTYLE = 2512, + SCI_SETCARETWIDTH = 2188, + SCI_SETCODEPAGE = 2037, + SCI_SETCONTROLCHARSYMBOL = 2388, + SCI_SETCURRENTPOS = 2141, + SCI_SETCURSOR = 2386, + SCI_SETDOCPOINTER = 2358, + SCI_SETEDGECOLOUR = 2365, + SCI_SETEDGECOLUMN = 2361, + SCI_SETEDGEMODE = 2363, + SCI_SETENDATLASTLINE = 2277, + SCI_SETEOLMODE = 2031, + SCI_SETFOCUS = 2380, + SCI_SETFOLDEXPANDED = 2229, + SCI_SETFOLDLEVEL = 2222, + SCI_SETHIGHLIGHTGUIDE = 2134, + SCI_SETHOTSPOTACTIVEUNDERLINE = 2412, + SCI_SETHOTSPOTSINGLELINE = 2421, + SCI_SETHSCROLLBAR = 2130, + SCI_SETINDENT = 2122, + SCI_SETINDENTATIONGUIDES = 2132, + SCI_SETINDICATORCURRENT = 2500, + SCI_SETINDICATORVALUE = 2502, + SCI_SETKEYWORDS = 4005, + SCI_SETLAYOUTCACHE = 2272, + SCI_SETLEXER = 4001, + SCI_SETLINEINDENTATION = 2126, + SCI_SETLINESTATE = 2092, + SCI_SETMARGINLEFT = 2155, + SCI_SETMARGINMASKN = 2244, + SCI_SETMARGINRIGHT = 2157, + SCI_SETMARGINSENSITIVEN = 2246, + SCI_SETMARGINTYPEN = 2240, + SCI_SETMARGINWIDTHN = 2242, + SCI_SETMODEVENTMASK = 2359, + SCI_SETMOUSEDOWNCAPTURES = 2384, + SCI_SETMOUSEDWELLTIME = 2264, + SCI_SETOVERTYPE = 2186, + SCI_SETPASTECONVERTENDINGS = 2467, + SCI_SETPOSITIONCACHE = 2514, + SCI_SETPRINTCOLOURMODE = 2148, + SCI_SETPRINTMAGNIFICATION = 2146, + SCI_SETPRINTWRAPMODE = 2406, + SCI_SETPROPERTY = 4004, + SCI_SETREADONLY = 2171, + SCI_SETSCROLLWIDTH = 2274, + SCI_SETSEARCHFLAGS = 2198, + SCI_SETSELALPHA = 2478, + SCI_SETSELECTIONEND = 2144, + SCI_SETSELECTIONMODE = 2422, + SCI_SETSELECTIONSTART = 2142, + SCI_SETSELEOLFILLED = 2480, + SCI_SETSTATUS = 2382, + SCI_SETSTYLEBITS = 2090, + SCI_SETTABINDENTS = 2260, + SCI_SETTABWIDTH = 2036, + SCI_SETTARGETEND = 2192, + SCI_SETTARGETSTART = 2190, + SCI_SETTWOPHASEDRAW = 2284, + SCI_SETUNDOCOLLECTION = 2012, + SCI_SETUSEPALETTE = 2039, + SCI_SETUSETABS = 2124, + SCI_SETVIEWEOL = 2356, + SCI_SETVIEWWS = 2021, + SCI_SETVSCROLLBAR = 2280, + SCI_SETWHITESPACECHARS = 2443, + SCI_SETWORDCHARS = 2077, + SCI_SETWRAPMODE = 2268, + SCI_SETWRAPSTARTINDENT = 2464, + SCI_SETWRAPVISUALFLAGS = 2460, + SCI_SETWRAPVISUALFLAGSLOCATION = 2462, + SCI_SETXOFFSET = 2397, + SCI_SETZOOM = 2373, + SCI_START = 2000, + SCI_STYLEGETBACK = 2482, + SCI_STYLEGETBOLD = 2483, + SCI_STYLEGETCASE = 2489, + SCI_STYLEGETCHANGEABLE = 2492, + SCI_STYLEGETCHARACTERSET = 2490, + SCI_STYLEGETEOLFILLED = 2487, + SCI_STYLEGETFORE = 2481, + SCI_STYLEGETHOTSPOT = 2493, + SCI_STYLEGETITALIC = 2484, + SCI_STYLEGETSIZE = 2485, + SCI_STYLEGETUNDERLINE = 2488, + SCI_STYLEGETVISIBLE = 2491, + SCI_STYLESETBACK = 2052, + SCI_STYLESETBOLD = 2053, + SCI_STYLESETCASE = 2060, + SCI_STYLESETCHANGEABLE = 2099, + SCI_STYLESETCHARACTERSET = 2066, + SCI_STYLESETEOLFILLED = 2057, + SCI_STYLESETFONT = 2056, + SCI_STYLESETFORE = 2051, + SCI_STYLESETHOTSPOT = 2409, + SCI_STYLESETITALIC = 2054, + SCI_STYLESETSIZE = 2055, + SCI_STYLESETUNDERLINE = 2059, + SCI_STYLESETVISIBLE = 2074, + SCK_ADD = 310, + SCK_BACK = 8, + SCK_DELETE = 308, + SCK_DIVIDE = 312, + SCK_DOWN = 300, + SCK_END = 305, + SCK_ESCAPE = 7, + SCK_HOME = 304, + SCK_INSERT = 309, + SCK_LEFT = 302, + SCK_MENU = 315, + SCK_NEXT = 307, + SCK_PRIOR = 306, + SCK_RETURN = 13, + SCK_RIGHT = 303, + SCK_RWIN = 314, + SCK_SUBTRACT = 311, + SCK_TAB = 9, + SCK_UP = 301, + SCK_WIN = 313, + SCLEX_AUTOMATIC = 1000, + SCLEX_CONTAINER = 0, + SCLEX_LPEG = 2, + SCLEX_NULL = 1, + SCMOD_ALT = 4, + SCMOD_CTRL = 2, + SCMOD_NORM = 0, + SCMOD_SHIFT = 1, + SCN_STYLENEEDED = 2000, + SCN_CHARADDED = 2001, + SCN_SAVEPOINTREACHED = 2002, + SCN_SAVEPOINTLEFT = 2003, + SCN_MODIFYATTEMPTRO = 2004, + SCN_KEY = 2005, + SCN_DOUBLECLICK =2006, + SCN_UPDATEUI = 2007, + SCN_MODIFIED = 2008, + SCN_MACRORECORD = 2009, + SCN_MARGINCLICK = 2010, + SCN_NEEDSHOWN = 2011, + SCN_PAINTED = 2013, + SCN_USERLISTSELECTION = 2014, + SCN_URIDROPPED = 2015, + SCN_DWELLSTART = 2016, + SCN_DWELLEND = 2017, + SCN_ZOOM = 2018, + SCN_HOTSPOTCLICK = 2019, + SCN_HOTSPOTDOUBLECLICK = 2020, + SCN_CALLTIPCLICK = 2021, + SCN_AUTOCSELECTION = 2022, + SCN_INDICATORCLICK = 2023, + SCN_INDICATORRELEASE = 2024, + SCWS_INVISIBLE = 0, + SCWS_VISIBLEAFTERINDENT = 2, + SCWS_VISIBLEALWAYS = 1, + SC_ALPHA_NOALPHA = 256, + SC_ALPHA_OPAQUE = 255, + SC_ALPHA_TRANSPARENT = 0, + SC_CACHE_CARET = 1, + SC_CACHE_DOCUMENT = 3, + SC_CACHE_NONE = 0, + SC_CACHE_PAGE = 2, + SC_CASE_LOWER = 2, + SC_CASE_MIXED = 0, + SC_CASE_UPPER = 1, + SC_CHARSET_8859_15 = 1000, + SC_CHARSET_ANSI = 0, + SC_CHARSET_ARABIC = 178, + SC_CHARSET_BALTIC = 186, + SC_CHARSET_CHINESEBIG5 = 136, + SC_CHARSET_CYRILLIC = 1251, + SC_CHARSET_DEFAULT = 1, + SC_CHARSET_EASTEUROPE = 238, + SC_CHARSET_GB2312 = 134, + SC_CHARSET_GREEK = 161, + SC_CHARSET_HANGUL = 129, + SC_CHARSET_HEBREW = 177, + SC_CHARSET_JOHAB = 130, + SC_CHARSET_MAC = 77, + SC_CHARSET_OEM = 255, + SC_CHARSET_RUSSIAN = 204, + SC_CHARSET_SHIFTJIS = 128, + SC_CHARSET_SYMBOL = 2, + SC_CHARSET_THAI = 222, + SC_CHARSET_TURKISH = 162, + SC_CHARSET_VIETNAMESE = 163, + SC_CP_DBCS = 1, + SC_CP_UTF8 = 65001, + SC_CURSORNORMAL = -1, + SC_CURSORWAIT = 4, + SC_EOL_CR = 1, + SC_EOL_CRLF = 0, + SC_EOL_LF = 2, + SC_FOLDFLAG_BOX = 0x0001, + SC_FOLDFLAG_LEVELNUMBERS = 0x0040, + SC_FOLDFLAG_LINEAFTER_CONTRACTED = 0x0010, + SC_FOLDFLAG_LINEAFTER_EXPANDED = 0x0008, + SC_FOLDFLAG_LINEBEFORE_CONTRACTED = 0x0004, + SC_FOLDFLAG_LINEBEFORE_EXPANDED = 0x0002, + SC_FOLDLEVELBASE = 0x400, + SC_FOLDLEVELBOXFOOTERFLAG = 0x8000, + SC_FOLDLEVELBOXHEADERFLAG = 0x4000, + SC_FOLDLEVELCONTRACTED = 0x10000, + SC_FOLDLEVELHEADERFLAG = 0x2000, + SC_FOLDLEVELNUMBERMASK = 0x0FFF, + SC_FOLDLEVELUNINDENT = 0x20000, + SC_FOLDLEVELWHITEFLAG = 0x1000, + SC_LASTSTEPINUNDOREDO = 0x100, + SC_MARGIN_BACK = 2, + SC_MARGIN_FORE = 3, + SC_MARGIN_NUMBER = 1, + SC_MARGIN_SYMBOL = 0, + SC_MARKNUM_FOLDER = 30, + SC_MARKNUM_FOLDEREND = 25, + SC_MARKNUM_FOLDERMIDTAIL = 27, + SC_MARKNUM_FOLDEROPEN = 31, + SC_MARKNUM_FOLDEROPENMID = 26, + SC_MARKNUM_FOLDERSUB = 29, + SC_MARKNUM_FOLDERTAIL = 28, + SC_MARK_ARROW = 2, + SC_MARK_ARROWDOWN = 6, + SC_MARK_ARROWS = 24, + SC_MARK_BACKGROUND = 22, + SC_MARK_BOXMINUS = 14, + SC_MARK_BOXMINUSCONNECTED = 15, + SC_MARK_BOXPLUS = 12, + SC_MARK_BOXPLUSCONNECTED = 13, + SC_MARK_CHARACTER = 10000, + SC_MARK_CIRCLE = 0, + SC_MARK_CIRCLEMINUS = 20, + SC_MARK_CIRCLEMINUSCONNECTED = 21, + SC_MARK_CIRCLEPLUS = 18, + SC_MARK_CIRCLEPLUSCONNECTED = 19, + SC_MARK_DOTDOTDOT = 23, + SC_MARK_EMPTY = 5, + SC_MARK_FULLRECT = 26, + SC_MARK_LCORNER = 10, + SC_MARK_LCORNERCURVE = 16, + SC_MARK_MINUS = 7, + SC_MARK_PIXMAP = 25, + SC_MARK_PLUS = 8, + SC_MARK_ROUNDRECT = 1, + SC_MARK_SHORTARROW = 4, + SC_MARK_SMALLRECT = 3, + SC_MARK_TCORNER = 11, + SC_MARK_TCORNERCURVE = 17, + SC_MARK_VLINE = 9, + SC_MASK_FOLDERS = 0xFE000000, + SC_MODEVENTMASKALL = 0x6FFF, + SC_MOD_BEFOREDELETE = 0x800, + SC_MOD_BEFOREINSERT = 0x400, + SC_MOD_CHANGEFOLD = 0x8, + SC_MOD_CHANGEINDICATOR = 0x4000, + SC_MOD_CHANGEMARKER = 0x200, + SC_MOD_CHANGESTYLE = 0x4, + SC_MOD_DELETETEXT = 0x2, + SC_MOD_INSERTTEXT = 0x1, + SC_MULTILINEUNDOREDO = 0x1000, + SC_MULTISTEPUNDOREDO = 0x80, + SC_PERFORMED_REDO = 0x40, + SC_PERFORMED_UNDO = 0x20, + SC_PERFORMED_USER = 0x10, + SC_PRINT_BLACKONWHITE = 2, + SC_PRINT_COLOURONWHITE = 3, + SC_PRINT_COLOURONWHITEDEFAULTBG = 4, + SC_PRINT_INVERTLIGHT = 1, + SC_PRINT_NORMAL = 0, + SC_SEL_LINES = 2, + SC_SEL_RECTANGLE = 1, + SC_SEL_STREAM = 0, + SC_STARTACTION = 0x2000, + SC_TIME_FOREVER = 10000000, + SC_WRAPVISUALFLAGLOC_DEFAULT = 0x0000, + SC_WRAPVISUALFLAGLOC_END_BY_TEXT = 0x0001, + SC_WRAPVISUALFLAGLOC_START_BY_TEXT = 0x0002, + SC_WRAPVISUALFLAG_END = 0x0001, + SC_WRAPVISUALFLAG_NONE = 0x0000, + SC_WRAPVISUALFLAG_START = 0x0002, + SC_WRAP_CHAR = 2, + SC_WRAP_NONE = 0, + SC_WRAP_WORD = 1, + STYLE_BRACEBAD = 35, + STYLE_BRACELIGHT = 34, + STYLE_CALLTIP = 38, + STYLE_CONTROLCHAR = 36, + STYLE_DEFAULT = 32, + STYLE_INDENTGUIDE = 37, + STYLE_LASTPREDEFINED = 39, + STYLE_LINENUMBER = 33, + STYLE_MAX = 127, + VISIBLE_SLOP = 0x01, + VISIBLE_STRICT = 0x04, +} + +textadept.buffer_functions = { + add_ref_document = {2376, 0, 0, 1}, + add_styled_text = {2002, 0, 2, 9}, + add_text = {2001, 0, 2, 7}, + allocate = {2446, 0, 1, 0}, + append_text = {2282, 0, 2, 7}, + assign_cmd_key = {2070, 0, 6, 1}, + auto_c_active = {2102, 5, 0, 0}, + auto_c_cancel = {2101, 0, 0, 0}, + auto_c_complete = {2104, 0, 0, 0}, + auto_c_get_current = {2445, 1, 0, 0}, + auto_c_pos_start = {2103, 3, 0, 0}, + auto_c_select = {2108, 0, 0, 7}, + auto_c_show = {2100, 0, 1, 7}, + auto_c_stops = {2105, 0, 0, 7}, + back_tab = {2328, 0, 0, 0}, + begin_undo_action = {2078, 0, 0, 0}, + brace_bad_light = {2352, 0, 3, 0}, + brace_highlight = {2351, 0, 3, 3}, + brace_match = {2353, 3, 3, 0}, + call_tip_active = {2202, 5, 0, 0}, + call_tip_cancel = {2201, 0, 0, 0}, + call_tip_pos_start = {2203, 3, 0, 0}, + call_tip_set_hlt = {2204, 0, 1, 1}, + call_tip_show = {2200, 0, 3, 7}, + can_paste = {2173, 5, 0, 0}, + can_redo = {2016, 5, 0, 0}, + can_undo = {2174, 5, 0, 0}, + cancel = {2325, 0, 0, 0}, + char_left = {2304, 0, 0, 0}, + char_left_extend = {2305, 0, 0, 0}, + char_left_rect_extend = {2428, 0, 0, 0}, + char_right = {2306, 0, 0, 0}, + char_right_extend = {2307, 0, 0, 0}, + char_right_rect_extend = {2429, 0, 0, 0}, + choose_caret_x = {2399, 0, 0, 0}, + clear = {2180, 0, 0, 0}, + clear_all = {2004, 0, 0, 0}, + clear_all_cmd_keys = {2072, 0, 0, 0}, + clear_cmd_key = {2071, 0, 6, 0}, + clear_document_style = {2005, 0, 0, 0}, + clear_registered_images = {2408, 0, 0, 0}, + colourise = {4003, 0, 3, 3}, + convert_eo_ls = {2029, 0, 1, 0}, + copy = {2178, 0, 0, 0}, + copy_range = {2419, 0, 3, 3}, + copy_text = {2420, 0, 2, 7}, + create_document = {2375, 1, 0, 0}, + cut = {2177, 0, 0, 0}, + del_line_left = {2395, 0, 0, 0}, + del_line_right = {2396, 0, 0, 0}, + del_word_left = {2335, 0, 0, 0}, + del_word_right = {2336, 0, 0, 0}, + delete_back = {2326, 0, 0, 0}, + delete_back_not_line = {2344, 0, 0, 0}, + doc_line_from_visible = {2221, 1, 1, 0}, + document_end = {2318, 0, 0, 0}, + document_end_extend = {2319, 0, 0, 0}, + document_start = {2316, 0, 0, 0}, + document_start_extend = {2317, 0, 0, 0}, + edit_toggle_overtype = {2324, 0, 0, 0}, + empty_undo_buffer = {2175, 0, 0, 0}, + encoded_from_utf8 = {2449, 1, 7, 8}, + end_undo_action = {2079, 0, 0, 0}, + ensure_visible = {2232, 0, 1, 0}, + ensure_visible_enforce_policy = {2234, 0, 1, 0}, + find_column = {2456, 1, 1, 1}, + find_text = {2150, 3, 1, 11}, + form_feed = {2330, 0, 0, 0}, + format_range = {2151, 3, 5, 12}, + get_cur_line = {2027, 1, 2, 8}, + get_hotspot_active_back = {2495, 4, 0, 0}, + get_hotspot_active_fore = {2494, 4, 0, 0}, + get_last_child = {2224, 1, 1, 1}, + get_lexer_language = {4012, 1, 0, 8}, + get_line = {2153, 1, 1, 8}, + get_line_sel_end_position = {2425, 3, 1, 0}, + get_line_sel_start_position = {2424, 3, 1, 0}, + get_property = {4008, 1, 7, 8}, + get_property_expanded = {4009, 1, 7, 8}, + get_sel_text = {2161, 1, 0, 8}, + get_style_name = {4013, 1, 1, 8}, + get_styled_text = {2015, 1, 0, 10}, + get_text = {2182, 1, 2, 8}, + get_text_range = {2162, 1, 0, 10}, + goto_line = {2024, 0, 1, 0}, + goto_pos = {2025, 0, 3, 0}, + grab_focus = {2400, 0, 0, 0}, + hide_lines = {2227, 0, 1, 1}, + hide_selection = {2163, 0, 5, 0}, + home = {2312, 0, 0, 0}, + home_display = {2345, 0, 0, 0}, + home_display_extend = {2346, 0, 0, 0}, + home_extend = {2313, 0, 0, 0}, + home_rect_extend = {2430, 0, 0, 0}, + home_wrap = {2349, 0, 0, 0}, + home_wrap_extend = {2450, 0, 0, 0}, + indicator_all_on_for = {2506, 1, 1, 0}, + indicator_clear_range = {2505, 0, 1, 1}, + indicator_end = {2509, 1, 1, 1}, + indicator_fill_range = {2504, 0, 1, 1}, + indicator_start = {2508, 1, 1, 1}, + indicator_value_at = {2507, 1, 1, 1}, + insert_text = {2003, 0, 3, 7}, + line_copy = {2455, 0, 0, 0}, + line_cut = {2337, 0, 0, 0}, + line_delete = {2338, 0, 0, 0}, + line_down = {2300, 0, 0, 0}, + line_down_extend = {2301, 0, 0, 0}, + line_down_rect_extend = {2426, 0, 0, 0}, + line_duplicate = {2404, 0, 0, 0}, + line_end = {2314, 0, 0, 0}, + line_end_display = {2347, 0, 0, 0}, + line_end_display_extend = {2348, 0, 0, 0}, + line_end_extend = {2315, 0, 0, 0}, + line_end_rect_extend = {2432, 0, 0, 0}, + line_end_wrap = {2451, 0, 0, 0}, + line_end_wrap_extend = {2452, 0, 0, 0}, + line_from_position = {2166, 1, 3, 0}, + line_length = {2350, 1, 1, 0}, + line_scroll = {2168, 0, 1, 1}, + line_scroll_down = {2342, 0, 0, 0}, + line_scroll_up = {2343, 0, 0, 0}, + line_transpose = {2339, 0, 0, 0}, + line_up = {2302, 0, 0, 0}, + line_up_extend = {2303, 0, 0, 0}, + line_up_rect_extend = {2427, 0, 0, 0}, + lines_join = {2288, 0, 0, 0}, + lines_split = {2289, 0, 1, 0}, + load_lexer_library = {4007, 0, 0, 7}, + lower_case = {2340, 0, 0, 0}, + marker_add = {2043, 1, 1, 1}, + marker_add_set = {2466, 0, 1, 1}, + marker_define = {2040, 0, 1, 1}, + marker_define_pixmap = {2049, 0, 1, 7}, + marker_delete = {2044, 0, 1, 1}, + marker_delete_all = {2045, 0, 1, 0}, + marker_delete_handle = {2018, 0, 1, 0}, + marker_get = {2046, 1, 1, 0}, + marker_line_from_handle = {2017, 1, 1, 0}, + marker_next = {2047, 1, 1, 1}, + marker_previous = {2048, 1, 1, 1}, + marker_set_alpha = {2476, 0, 1, 1}, + marker_set_back = {2042, 0, 1, 4}, + marker_set_fore = {2041, 0, 1, 4}, + move_caret_inside_view = {2401, 0, 0, 0}, + new_line = {2329, 0, 0, 0}, + null = {2172, 0, 0, 0}, + page_down = {2322, 0, 0, 0}, + page_down_extend = {2323, 0, 0, 0}, + page_down_rect_extend = {2434, 0, 0, 0}, + page_up = {2320, 0, 0, 0}, + page_up_extend = {2321, 0, 0, 0}, + page_up_rect_extend = {2433, 0, 0, 0}, + para_down = {2413, 0, 0, 0}, + para_down_extend = {2414, 0, 0, 0}, + para_up = {2415, 0, 0, 0}, + para_up_extend = {2416, 0, 0, 0}, + paste = {2179, 0, 0, 0}, + point_x_from_position = {2164, 1, 0, 3}, + point_y_from_position = {2165, 1, 0, 3}, + position_after = {2418, 3, 3, 0}, + position_before = {2417, 3, 3, 0}, + position_from_line = {2167, 3, 1, 0}, + position_from_point = {2022, 3, 1, 1}, + position_from_point_close = {2023, 3, 1, 1}, + redo = {2011, 0, 0, 0}, + register_image = {2405, 0, 1, 7}, + release_document = {2377, 0, 0, 1}, + replace_sel = {2170, 0, 0, 7}, + replace_target = {2194, 1, 2, 7}, + replace_target_re = {2195, 1, 2, 7}, + scroll_caret = {2169, 0, 0, 0}, + search_anchor = {2366, 0, 0, 0}, + search_in_target = {2197, 1, 2, 7}, + search_next = {2367, 1, 1, 7}, + search_prev = {2368, 1, 1, 7}, + select_all = {2013, 0, 0, 0}, + selection_duplicate = {2469, 0, 0, 0}, + set_chars_default = {2444, 0, 0, 0}, + set_fold_flags = {2233, 0, 1, 0}, + set_fold_margin_colour = {2290, 0, 5, 4}, + set_fold_margin_hi_colour = {2291, 0, 5, 4}, + set_hotspot_active_back = {2411, 0, 5, 4}, + set_hotspot_active_fore = {2410, 0, 5, 4}, + set_length_for_encode = {2448, 0, 1, 0}, + set_lexer_language = {4006, 0, 0, 7}, + set_save_point = {2014, 0, 0, 0}, + set_sel = {2160, 0, 3, 3}, + set_sel_back = {2068, 0, 5, 4}, + set_sel_fore = {2067, 0, 5, 4}, + set_styling = {2033, 0, 2, 1}, + set_styling_ex = {2073, 0, 2, 7}, + set_text = {2181, 0, 0, 7}, + set_visible_policy = {2394, 0, 1, 1}, + set_whitespace_back = {2085, 0, 5, 4}, + set_whitespace_fore = {2084, 0, 5, 4}, + set_x_caret_policy = {2402, 0, 1, 1}, + set_y_caret_policy = {2403, 0, 1, 1}, + show_lines = {2226, 0, 1, 1}, + start_record = {3001, 0, 0, 0}, + start_styling = {2032, 0, 3, 1}, + stop_record = {3002, 0, 0, 0}, + stuttered_page_down = {2437, 0, 0, 0}, + stuttered_page_down_extend = {2438, 0, 0, 0}, + stuttered_page_up = {2435, 0, 0, 0}, + stuttered_page_up_extend = {2436, 0, 0, 0}, + style_clear_all = {2050, 0, 0, 0}, + style_get_font = {2486, 1, 1, 8}, + style_reset_default = {2058, 0, 0, 0}, + tab = {2327, 0, 0, 0}, + target_as_utf8 = {2447, 1, 0, 8}, + target_from_selection = {2287, 0, 0, 0}, + text_height = {2279, 1, 1, 0}, + text_width = {2276, 1, 1, 7}, + toggle_caret_sticky = {2459, 0, 0, 0}, + toggle_fold = {2231, 0, 1, 0}, + undo = {2176, 0, 0, 0}, + upper_case = {2341, 0, 0, 0}, + use_pop_up = {2371, 0, 5, 0}, + user_list_show = {2117, 0, 1, 7}, + vc_home = {2331, 0, 0, 0}, + vc_home_extend = {2332, 0, 0, 0}, + vc_home_rect_extend = {2431, 0, 0, 0}, + vc_home_wrap = {2453, 0, 0, 0}, + vc_home_wrap_extend = {2454, 0, 0, 0}, + visible_from_doc_line = {2220, 1, 1, 0}, + word_end_position = {2267, 1, 3, 5}, + word_left = {2308, 0, 0, 0}, + word_left_end = {2439, 0, 0, 0}, + word_left_end_extend = {2440, 0, 0, 0}, + word_left_extend = {2309, 0, 0, 0}, + word_part_left = {2390, 0, 0, 0}, + word_part_left_extend = {2391, 0, 0, 0}, + word_part_right = {2392, 0, 0, 0}, + word_part_right_extend = {2393, 0, 0, 0}, + word_right = {2310, 0, 0, 0}, + word_right_end = {2441, 0, 0, 0}, + word_right_end_extend = {2442, 0, 0, 0}, + word_right_extend = {2311, 0, 0, 0}, + word_start_position = {2266, 1, 3, 5}, + wrap_count = {2235, 1, 1, 0}, + zoom_in = {2333, 0, 0, 0}, + zoom_out = {2334, 0, 0, 0}, +} + +textadept.buffer_properties = { + anchor = {2009, 2026, 3, 0}, + auto_c_auto_hide = {2119, 2118, 5, 0}, + auto_c_cancel_at_start = {2111, 2110, 5, 0}, + auto_c_choose_single = {2114, 2113, 5, 0}, + auto_c_drop_rest_of_word = {2271, 2270, 5, 0}, + auto_c_fill_ups = {0, 2112, 7, 0}, + auto_c_ignore_case = {2116, 2115, 5, 0}, + auto_c_max_height = {2211, 2210, 1, 0}, + auto_c_max_width = {2209, 2208, 1, 0}, + auto_c_separator = {2107, 2106, 1, 0}, + auto_c_type_separator = {2285, 2286, 1, 0}, + back_space_un_indents = {2263, 2262, 5, 0}, + buffered_draw = {2034, 2035, 5, 0}, + call_tip_back = {0, 2205, 4, 0}, + call_tip_fore = {0, 2206, 4, 0}, + call_tip_fore_hlt = {0, 2207, 4, 0}, + call_tip_use_style = {0, 2212, 1, 0}, + caret_fore = {2138, 2069, 4, 0}, + caret_line_back = {2097, 2098, 4, 0}, + caret_line_back_alpha = {2471, 2470, 1, 0}, + caret_line_visible = {2095, 2096, 5, 0}, + caret_period = {2075, 2076, 1, 0}, + caret_sticky = {2457, 2458, 5, 0}, + caret_style = {2513, 2512, 1, 0}, + caret_width = {2189, 2188, 1, 0}, + char_at = {2007, 0, 1, 3}, + code_page = {2137, 2037, 1, 0}, + column = {2129, 0, 1, 3}, + control_char_symbol = {2389, 2388, 1, 0}, + current_pos = {2008, 2141, 3, 0}, + cursor = {2387, 2386, 1, 0}, + direct_function = {2184, 0, 1, 0}, + direct_pointer = {2185, 0, 1, 0}, + doc_pointer = {2357, 2358, 1, 0}, + eol_mode = {2030, 2031, 1, 0}, + edge_colour = {2364, 2365, 4, 0}, + edge_column = {2360, 2361, 1, 0}, + edge_mode = {2362, 2363, 1, 0}, + end_at_last_line = {2278, 2277, 5, 0}, + end_styled = {2028, 0, 3, 0}, + first_visible_line = {2152, 0, 1, 0}, + focus = {2381, 2380, 5, 0}, + fold_expanded = {2230, 2229, 5, 1}, + fold_level = {2223, 2222, 1, 1}, + fold_parent = {2225, 0, 1, 1}, + h_scroll_bar = {2131, 2130, 5, 0}, + highlight_guide = {2135, 2134, 1, 0}, + hotspot_active_underline = {2496, 2412, 5, 0}, + hotspot_single_line = {2497, 2421, 5, 0}, + indent = {2123, 2122, 1, 0}, + indentation_guides = {2133, 2132, 5, 0}, + indic_fore = {2083, 2082, 4, 1}, + indic_style = {2081, 2080, 1, 1}, + indic_under = {2511, 2510, 5, 1}, + indicator_current = {2501, 2500, 1, 0}, + indicator_value = {2503, 2502, 1, 0}, + key_words = {0, 4005, 7, 1}, + layout_cache = {2273, 2272, 1, 0}, + length = {2006, 0, 1, 0}, + lexer = {4002, 4001, 1, 0}, + line_count = {2154, 0, 1, 0}, + line_end_position = {2136, 0, 1, 1}, + line_indent_position = {2128, 0, 3, 1}, + line_indentation = {2127, 2126, 1, 1}, + line_state = {2093, 2092, 1, 1}, + line_visible = {2228, 0, 5, 1}, + lines_on_screen = {2370, 0, 1, 0}, + margin_left = {2156, 2155, 1, 0}, + margin_mask_n = {2245, 2244, 1, 1}, + margin_right = {2158, 2157, 1, 0}, + margin_sensitive_n = {2247, 2246, 5, 1}, + margin_type_n = {2241, 2240, 1, 1}, + margin_width_n = {2243, 2242, 1, 1}, + max_line_state = {2094, 0, 1, 0}, + mod_event_mask = {2378, 2359, 1, 0}, + modify = {2159, 0, 5, 0}, + mouse_down_captures = {2385, 2384, 5, 0}, + mouse_dwell_time = {2265, 2264, 1, 0}, + overtype = {2187, 2186, 5, 0}, + paste_convert_endings = {2468, 2467, 5, 0}, + position_cache = {2515, 2514, 1, 0}, + print_colour_mode = {2149, 2148, 1, 0}, + print_magnification = {2147, 2146, 1, 0}, + print_wrap_mode = {2407, 2406, 1, 0}, + property = {0, 4004, 7, 7}, + property_int = {4010, 0, 1, 7}, + read_only = {2140, 2171, 5, 0}, + scroll_width = {2275, 2274, 1, 0}, + search_flags = {2199, 2198, 1, 0}, + sel_alpha = {2477, 2478, 1, 0}, + sel_eol_filled = {2479, 2480, 5, 0}, + selection_end = {2145, 2144, 3, 0}, + selection_is_rectangle = {2372, 0, 5, 0}, + selection_mode = {2423, 2422, 1, 0}, + selection_start = {2143, 2142, 3, 0}, + status = {2383, 2382, 1, 0}, + style_at = {2010, 0, 1, 3}, + style_back = {2482, 2052, 4, 1}, + style_bits = {2091, 2090, 1, 0}, + style_bits_needed = {4011, 0, 1, 0}, + style_bold = {2483, 2053, 5, 1}, + style_case = {2489, 2060, 1, 1}, + style_changeable = {2492, 2099, 5, 1}, + style_character_set = {2490, 2066, 1, 1}, + style_eol_filled = {2487, 2057, 5, 1}, + style_font = {0, 2056, 7, 1}, + style_fore = {2481, 2051, 4, 1}, + style_hot_spot = {2493, 2409, 5, 1}, + style_italic = {2484, 2054, 5, 1}, + style_size = {2485, 2055, 1, 1}, + style_underline = {2488, 2059, 5, 1}, + style_visible = {2491, 2074, 5, 1}, + tab_indents = {2261, 2260, 5, 0}, + tab_width = {2121, 2036, 1, 0}, + target_end = {2193, 2192, 3, 0}, + target_start = {2191, 2190, 3, 0}, + text_length = {2183, 0, 1, 0}, + two_phase_draw = {2283, 2284, 5, 0}, + undo_collection = {2019, 2012, 5, 0}, + use_palette = {2139, 2039, 5, 0}, + use_tabs = {2125, 2124, 5, 0}, + v_scroll_bar = {2281, 2280, 5, 0}, + view_eol = {2355, 2356, 5, 0}, + view_ws = {2020, 2021, 1, 0}, + whitespace_chars = {0, 2443, 7, 0}, + word_chars = {0, 2077, 7, 0}, + wrap_mode = {2269, 2268, 1, 0}, + wrap_start_indent = {2465, 2464, 1, 0}, + wrap_visual_flags = {2461, 2460, 1, 0}, + wrap_visual_flags_location = {2463, 2462, 1, 0}, + x_offset = {2398, 2397, 1, 0}, + zoom = {2374, 2373, 1, 0}, +} diff --git a/core/init.lua b/core/init.lua new file mode 100644 index 00000000..297495e6 --- /dev/null +++ b/core/init.lua @@ -0,0 +1,21 @@ +-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE. + +--- +-- Checks if the buffer being indexed is the currently focused buffer. +-- This is necessary because any buffer actions are performed in the focused +-- views' buffer, which may not be the buffer being indexed. Throws an error +-- if the check fails. +-- @param buffer The buffer in question. +function textadept.check_focused_buffer(buffer) + if type(buffer) ~= 'table' or not buffer.doc_pointer then + error('Buffer argument expected.', 2) + elseif textadept.focused_doc_pointer ~= buffer.doc_pointer then + error('The indexed buffer is not the focused one.', 2) + end +end + +package.path = package.path..';'.._HOME..'/core/?.lua' + +require 'iface' +require 'handlers' +require 'file_io' |