From f2374c4aba53fa462dc88d4104e10d8cb97e61ba Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 25 May 2020 21:16:01 -0400 Subject: Allow views to be used as buffers and update API. This allows for a superficial separation of buffer- and view-specific Scintilla functionality. buffers and views can now be used interchangeably for the most part, and the APIs are guidance, not hard requirements. User scripts do not require any modification and will continue to function normally. --- modules/textadept/file_types.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/textadept/file_types.lua') diff --git a/modules/textadept/file_types.lua b/modules/textadept/file_types.lua index 2889734c..34ae1dae 100644 --- a/modules/textadept/file_types.lua +++ b/modules/textadept/file_types.lua @@ -70,7 +70,7 @@ local function set_lexer(buffer, lang) buffer._lexer = lang if package.searchpath(lang, package.path) then _M[lang] = require(lang) end if buffer ~= ui.command_entry then events.emit(events.LEXER_LOADED, lang) end - local last_line = buffer.first_visible_line + buffer.lines_on_screen + local last_line = view.first_visible_line + view.lines_on_screen buffer:colourise(1, buffer:position_from_line(last_line + 1)) -- refresh end -- cgit v1.2.3