aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/file_types.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-10-18 12:05:32 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-10-18 12:05:32 -0400
commit20c4fb3baaac9d176e029e3680cc0c8e8101e44c (patch)
tree785ad6aefe188739ffe8560cd6138e8309425f9c /modules/textadept/file_types.lua
parent8f682b9de06785cd20b9fb6e18460a1e53fd1ca1 (diff)
downloadtextadept-20c4fb3baaac9d176e029e3680cc0c8e8101e44c.tar.gz
textadept-20c4fb3baaac9d176e029e3680cc0c8e8101e44c.zip
The buffer API applies to all buffers now, not just the global one.
Created a "dummy" Scintilla view for operating on non-global documents. Removed `buffer:check_global()` and replaced `buffer.dirty` with Scintilla's `buffer.modify`.
Diffstat (limited to 'modules/textadept/file_types.lua')
-rw-r--r--modules/textadept/file_types.lua5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/textadept/file_types.lua b/modules/textadept/file_types.lua
index 2a992767..ebff94c6 100644
--- a/modules/textadept/file_types.lua
+++ b/modules/textadept/file_types.lua
@@ -51,7 +51,6 @@ M.lexers = {}
local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1]
-- LuaDoc is in core/.buffer.luadoc.
local function get_lexer(buffer, current)
- buffer:check_global()
local lexer = buffer:private_lexer_call(GETLEXERLANGUAGE)
return current and lexer:match('[^/]+$') or lexer:match('^[^/]+')
end
@@ -60,8 +59,6 @@ local SETDIRECTPOINTER = _SCINTILLA.properties.doc_pointer[2]
local SETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[2]
-- LuaDoc is in core/.buffer.luadoc.
local function set_lexer(buffer, lang)
- buffer:check_global()
-
-- If no language was given, attempt to detect it.
if not lang then
local line = buffer:get_line(0)
@@ -85,9 +82,9 @@ local function set_lexer(buffer, lang)
end
-- Set the lexer and load its language module.
- buffer._lexer = lang
buffer:private_lexer_call(SETDIRECTPOINTER, buffer.direct_pointer)
buffer:private_lexer_call(SETLEXERLANGUAGE, lang)
+ buffer._lexer = lang
if package.searchpath(lang, package.path) then
_M[lang] = require(lang)
local post_init = lang..'.post_init'