diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-11-01 15:36:50 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-11-01 15:58:49 +0100 |
| commit | c4aaea6a0ec0438d6bd0da1c0650fe5ff272abe6 (patch) | |
| tree | b4efddc2c77bf72c7eb2cccea41a341f35fad4f7 | |
| parent | 0baf5945bca147d09e29920e07ba43c187484238 (diff) | |
| download | vis-c4aaea6a0ec0438d6bd0da1c0650fe5ff272abe6.tar.gz vis-c4aaea6a0ec0438d6bd0da1c0650fe5ff272abe6.tar.xz | |
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.
| -rw-r--r-- | vis.lua | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 |
