aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/textadept
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-13 00:02:12 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-13 00:02:12 -0400
commit3d69ae01c0f2421a89b862ec5fea635a40826896 (patch)
tree0930132b4c69c144538340b48b7c52accc639b61 /modules/textadept
parent19899b518f18165b1dfb6d9b4b18e531f4b56249 (diff)
Updated to Scintilla 5.0.1 and latest Scintillua and Scinterm.
Some of the Scintilla API has changed, and by extension the Scintillua API.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/file_types.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/textadept/file_types.lua b/modules/textadept/file_types.lua
index ac9c88f9..c9a32979 100644
--- a/modules/textadept/file_types.lua
+++ b/modules/textadept/file_types.lua
@@ -34,10 +34,10 @@ M.extensions = {--[[Actionscript]]as='actionscript',asc='actionscript',--[[Ada]]
M.patterns = {['^#!.+[/ ][gm]?awk']='awk',['^#!.+[/ ]lua']='lua',['^#!.+[/ ]octave']='matlab',['^#!.+[/ ]perl']='perl',['^#!.+[/ ]php']='php',['^#!.+[/ ]python']='python',['^#!.+[/ ]ruby']='ruby',['^#!.+[/ ]bash']='bash',['^#!.+/m?ksh']='bash',['^#!.+/sh']='bash',['^%s*class%s+%S+%s*<%s*ApplicationController']='rails',['^%s*class%s+%S+%s*<%s*ActionController::Base']='rails',['^%s*class%s+%S+%s*<%s*ActiveRecord::Base']='rails',['^%s*class%s+%S+%s*<%s*ActiveRecord::Migration']='rails',['^%s*<%?xml%s']='xml',['^#cloud%-config']='yaml'}
-- LuaFormatter on
-local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1]
+local GETLEXER = _SCINTILLA.properties.lexer[1]
-- LuaDoc is in core/.buffer.luadoc.
local function get_lexer(buffer, current)
- local name = buffer:private_lexer_call(GETLEXERLANGUAGE)
+ local name = buffer:private_lexer_call(GETLEXER)
return current and name:match('[^/]+$') or name:match('^[^/]+')
end
@@ -53,17 +53,17 @@ local function detect_language(buffer)
end
local SETDIRECTPOINTER = _SCINTILLA.properties.doc_pointer[2]
-local SETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[2]
+local SETLEXER = _SCINTILLA.properties.i_lexer[2]
local GETERROR = _SCINTILLA.properties.status[1]
-- LuaDoc is in core/.buffer.luadoc.
local function set_lexer(buffer, name)
assert_type(name, 'string/nil', 2)
if not name then name = detect_language(buffer) or 'text' end
buffer:private_lexer_call(SETDIRECTPOINTER, buffer.direct_pointer)
- buffer:private_lexer_call(SETLEXERLANGUAGE, name)
+ buffer:private_lexer_call(SETLEXER, name)
local errmsg = buffer:private_lexer_call(GETERROR)
if #errmsg > 0 then
- buffer:private_lexer_call(SETLEXERLANGUAGE, 'text')
+ buffer:private_lexer_call(SETLEXER, 'text')
error(errmsg, 2)
end
buffer._lexer = name
@@ -89,14 +89,14 @@ events.connect(events.VIEW_AFTER_SWITCH, restore_lexer)
events.connect(events.VIEW_NEW, restore_lexer)
events.connect(events.RESET_AFTER, restore_lexer)
-local LEXERNAMES = _SCINTILLA.functions.property_names[1]
+local LEXERS = _SCINTILLA.properties.lexer_language[1]
---
-- Prompts the user to select a lexer for the current buffer.
-- @see buffer.set_lexer
-- @name select_lexer
function M.select_lexer()
local lexers = {}
- for name in buffer:private_lexer_call(LEXERNAMES):gmatch('[^\n]+') do lexers[#lexers + 1] = name end
+ for name in buffer:private_lexer_call(LEXERS):gmatch('[^\n]+') do lexers[#lexers + 1] = name end
local button, i = ui.dialogs.filteredlist{
title = _L['Select Lexer'], columns = _L['Name'], items = lexers
}