From 1be7d50f3cee5aa4a06c083d195290e8fe8cacaf Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 5 Oct 2014 00:28:18 -0400 Subject: Replaced command entry text field with a Scintilla buffer. `ui.command_entry` now has the same functions and fields as `buffer`s as well as an additional `height` property. Note that when the command entry is active, `_G.buffer` is unchanged, so many existing key commands cannot be bound to command entry key modes. See `keys.lua_command` in *modules/textadept/command_entry.lua* for the proper way to bind them. Removed `ui.command_entry.entry_text` and `ui.command_entry.show_completions()`. --- modules/textadept/file_types.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'modules/textadept/file_types.lua') diff --git a/modules/textadept/file_types.lua b/modules/textadept/file_types.lua index cb5c34da..48c3414e 100644 --- a/modules/textadept/file_types.lua +++ b/modules/textadept/file_types.lua @@ -94,7 +94,7 @@ local function set_lexer(buffer, lang) end -- Gives new buffers lexer-specific functions. -local function set_lexer_functions() +events.connect(events.BUFFER_NEW, function() buffer.get_lexer, buffer.set_lexer = get_lexer, set_lexer buffer.style_name = setmetatable({}, { __index = function(t, style_num) -- LuaDoc is in core/.buffer.luadoc @@ -103,8 +103,7 @@ local function set_lexer_functions() end, __newindex = function() error('read-only property') end }) -end -events.connect(events.BUFFER_NEW, set_lexer_functions, 1) +end, 1) -- Auto-detect lexer on file open or save as. events.connect(events.FILE_OPENED, function() buffer:set_lexer() end) -- cgit v1.2.3