aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/file_types.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-10-05 00:28:18 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-10-05 00:28:18 -0400
commit1be7d50f3cee5aa4a06c083d195290e8fe8cacaf (patch)
treeeff35c8d3adfbdf6a9678aba4a53592f9647d359 /modules/textadept/file_types.lua
parent6de8b710a1fb0c818c22de19cefc125224555101 (diff)
downloadtextadept-1be7d50f3cee5aa4a06c083d195290e8fe8cacaf.tar.gz
textadept-1be7d50f3cee5aa4a06c083d195290e8fe8cacaf.zip
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()`.
Diffstat (limited to 'modules/textadept/file_types.lua')
-rw-r--r--modules/textadept/file_types.lua5
1 files changed, 2 insertions, 3 deletions
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)