aboutsummaryrefslogtreecommitdiff
path: root/vis.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-21 12:29:59 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-22 00:05:30 +0200
commit29f8d2488cfe86678e65e73c58e36d7c48a0e11b (patch)
treebc58ec4a206c1a5d393a67837acb5ea1cce02193 /vis.lua
parentb36ddb65334b4de406304786abfbde85b1e9a4e4 (diff)
downloadvis-29f8d2488cfe86678e65e73c58e36d7c48a0e11b.tar.gz
vis-29f8d2488cfe86678e65e73c58e36d7c48a0e11b.tar.xz
vis: consider :set horizon setting when syntax highlighting
Diffstat (limited to 'vis.lua')
-rw-r--r--vis.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/vis.lua b/vis.lua
index 59d0590..297c09e 100644
--- a/vis.lua
+++ b/vis.lua
@@ -250,7 +250,7 @@ vis.events.win_syntax = function(win, name)
return true
end
-vis.events.win_highlight = function(win)
+vis.events.win_highlight = function(win, horizon_max)
if win.syntax == nil or vis.lexers == nil then
return
end
@@ -261,7 +261,6 @@ vis.events.win_highlight = function(win)
-- TODO: improve heuristic for initial style
local viewport = win.viewport
- local horizon_max = 32768
local horizon = viewport.start < horizon_max and viewport.start or horizon_max
local view_start = viewport.start
local lex_start = viewport.start - horizon