From 20c4fb3baaac9d176e029e3680cc0c8e8101e44c Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 18 Oct 2013 12:05:32 -0400 Subject: 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`. --- modules/textadept/file_types.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modules/textadept/file_types.lua') 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' -- cgit v1.2.3