From c4aaea6a0ec0438d6bd0da1c0650fe5ff272abe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 1 Nov 2016 15:36:50 +0100 Subject: vis: abort syntax highlighting if viewport is invalid In theory this should not happen in the first place, but in practice it might fix the symptoms reported in issue #367. --- vis.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vis.lua b/vis.lua index f4a5232..c8d1bb3 100644 --- a/vis.lua +++ b/vis.lua @@ -345,6 +345,9 @@ vis.events.win_highlight = function(win, horizon_max) -- TODO: improve heuristic for initial style local viewport = win.viewport + if not viewport then + return + end local horizon = viewport.start < horizon_max and viewport.start or horizon_max local view_start = viewport.start local lex_start = viewport.start - horizon -- cgit v1.2.3