From ee8e402829b65901351bbbf7417c291da7c3b541 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 1 Jan 2014 12:28:33 -0500 Subject: Merge the separate Textadept and lexer Lua states into a single unified one. This is an experimental change and requires the latest Scintillua changes. --- core/ui.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/ui.lua') diff --git a/core/ui.lua b/core/ui.lua index a4ceeac2..09d273c0 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -249,6 +249,7 @@ events_connect(events.VIEW_NEW, function() events.emit(events.UPDATE_UI) end) local SETDIRECTFUNCTION = _SCINTILLA.properties.direct_function[1] local SETDIRECTPOINTER = _SCINTILLA.properties.doc_pointer[2] +local SETLUASTATE = _SCINTILLA.functions.change_lexer_state[1] local SETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[2] -- Sets default properties for a Scintilla document. events_connect(events.BUFFER_NEW, function() @@ -257,6 +258,7 @@ events_connect(events.BUFFER_NEW, function() buffer.lexer_language = 'lpeg' buffer:private_lexer_call(SETDIRECTFUNCTION, buffer.direct_function) buffer:private_lexer_call(SETDIRECTPOINTER, buffer.direct_pointer) + buffer:private_lexer_call(SETLUASTATE, _LUA) buffer.property['lexer.lpeg.home'] = _USERHOME..'/lexers/?.lua;'.. _HOME..'/lexers' load_theme_and_settings() @@ -441,7 +443,7 @@ local goto_view -- Low-level function for creating a menu from table *menu_table* and returning -- the userdata. -- You probably want to use the higher-level `textadept.menu.set_menubar()` --- or `textadept.menu.set_contextmenus()` functions. Emits a `MENU_CLICKED` +-- or `textadept.menu.set_contextmenus()` functions. Emits a `MENU_CLICKED` -- event when a menu item is selected. -- @param menu_table A table defining the menu. It is an ordered list of tables -- with a string menu item, integer menu ID, and optional GDK keycode and -- cgit v1.2.3