aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-03-14 16:53:53 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-03-14 19:04:21 +0100
commit9bcf2667e7e239873597b7ec2172206a9af18071 (patch)
tree7e9ccb42fa665ba01be65b93fc995fa76719aaf7 /lua
parentbed289a96e1ed17e4b9fa4f9e22227fcf13cc818 (diff)
downloadvis-9bcf2667e7e239873597b7ec2172206a9af18071.tar.gz
vis-9bcf2667e7e239873597b7ec2172206a9af18071.tar.xz
Restructure display code
Use pull instead of push based model for display code. Previously view.c was calling into the ui frontend code, with the new scheme this switches around: the necessary data is fetched by the ui as necessary. The UI independent display code is moved out of view.c/ui-curses.c into vis.c. The cell styles are now directly embedded into the Cell struct. New UI styles are introduced for: - status bar (focused / non-focused) - info message - window separator - EOF symbol You will have to update your color themes. The terminal output code is further abstracted into a generic ui-terminal.c part which keeps track of the whole in-memory cell matrix and #includes ui-terminal-curses.c for the actual terminal output. This architecture currently assumes that there are no overlapping windows. It will also allow non-curses based terminal user interfaces.
Diffstat (limited to 'lua')
-rw-r--r--lua/themes/dark-16.lua7
-rw-r--r--lua/themes/light-16.lua5
-rw-r--r--lua/themes/solarized.lua5
-rw-r--r--lua/vis-std.lua5
4 files changed, 21 insertions, 1 deletions
diff --git a/lua/themes/dark-16.lua b/lua/themes/dark-16.lua
index 986c4b3..fcfc1f8 100644
--- a/lua/themes/dark-16.lua
+++ b/lua/themes/dark-16.lua
@@ -1,7 +1,7 @@
-- Eight-color scheme
local lexers = vis.lexers
-- dark
-lexers.STYLE_DEFAULT = 'back:black,fore:white'
+lexers.STYLE_DEFAULT ='back:black,fore:white'
lexers.STYLE_NOTHING = 'back:black'
lexers.STYLE_CLASS = 'fore:yellow,bold'
lexers.STYLE_COMMENT = 'fore:blue,bold'
@@ -29,3 +29,8 @@ lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:yellow'
lexers.STYLE_CURSOR_LINE = 'underlined'
lexers.STYLE_COLOR_COLUMN = 'back:red'
lexers.STYLE_SELECTION = 'back:white'
+lexers.STYLE_STATUS = 'reverse'
+lexers.STYLE_STATUS_FOCUSED = 'reverse,bold'
+lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT
+lexers.STYLE_INFO = 'fore:default,back:default,bold'
+lexers.STYLE_EOF = ''
diff --git a/lua/themes/light-16.lua b/lua/themes/light-16.lua
index b4ba391..cf72f7f 100644
--- a/lua/themes/light-16.lua
+++ b/lua/themes/light-16.lua
@@ -29,3 +29,8 @@ lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:yellow'
lexers.STYLE_CURSOR_LINE = 'underlined'
lexers.STYLE_COLOR_COLUMN = 'back:red'
lexers.STYLE_SELECTION = 'back:black'
+lexers.STYLE_STATUS = 'reverse'
+lexers.STYLE_STATUS_FOCUSED = 'reverse,bold'
+lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT
+lexers.STYLE_INFO = 'fore:default,back:default,bold'
+lexers.STYLE_EOF = ''
diff --git a/lua/themes/solarized.lua b/lua/themes/solarized.lua
index 70ad51f..04540ec 100644
--- a/lua/themes/solarized.lua
+++ b/lua/themes/solarized.lua
@@ -57,3 +57,8 @@ lexers.STYLE_CURSOR_LINE = 'back:'..colors.base02
lexers.STYLE_COLOR_COLUMN = 'back:'..colors.base02
-- lexers.STYLE_SELECTION = 'back:'..colors.base02
lexers.STYLE_SELECTION = 'back:white'
+lexers.STYLE_STATUS = 'back:black,fore:white'
+lexers.STYLE_STATUS_FOCUSED = lexers.STYLE_STATUS..',bold'
+lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT
+lexers.STYLE_INFO = 'fore:default,back:default,bold'
+lexers.STYLE_EOF = ''
diff --git a/lua/vis-std.lua b/lua/vis-std.lua
index a0b84f6..4492fcc 100644
--- a/lua/vis-std.lua
+++ b/lua/vis-std.lua
@@ -32,6 +32,11 @@ vis.events.subscribe(vis.events.WIN_SYNTAX, function(win, name)
win:style_define(win.STYLE_SELECTION, lexers.STYLE_SELECTION or '')
win:style_define(win.STYLE_LINENUMBER, lexers.STYLE_LINENUMBER or '')
win:style_define(win.STYLE_COLOR_COLUMN, lexers.STYLE_COLOR_COLUMN or '')
+ win:style_define(win.STYLE_STATUS, lexers.STYLE_STATUS or '')
+ win:style_define(win.STYLE_STATUS_FOCUSED, lexers.STYLE_STATUS_FOCUSED or '')
+ win:style_define(win.STYLE_SEPARATOR, lexers.STYLE_SEPARATOR or '')
+ win:style_define(win.STYLE_INFO, lexers.STYLE_INFO or '')
+ win:style_define(win.STYLE_EOF, lexers.STYLE_EOF or '')
if name == nil then return true end