1
0
Fork 0

vis: rework statusline

main
urosm 2024-09-13 20:30:45 +02:00
parent 3dc0c6a102
commit 852aeb11f3
1 changed files with 17 additions and 17 deletions

View File

@ -83,39 +83,39 @@ e.subscribe(e.WIN_STATUS, function(win)
local file = win.file local file = win.file
local selection = win.selection local selection = win.selection
local file_info = (file.name or '[No Name]')..(file.modified and '[+]' or '') -- file info
table.insert(left_parts,
(file.name or '[No Name]')..(file.modified and '[+]' or ''))
-- selection
table.insert(right_parts, selection.number..'/'..#win.selections)
if vis.win == win then if vis.win == win then
-- mode -- mode
table.insert(left_parts, mode_strings[vis.mode]) table.insert(left_parts, 1, mode_strings[vis.mode])
-- selection -- syntax
table.insert(left_parts, selection.number..'/'..#win.selections) table.insert(left_parts, win.syntax)
-- file info -- input info
file_info = table.insert(left_parts,
file_info '<'
..':'
..(vis.count or '') ..(vis.count or '')
..(vis.input_queue or '') ..(vis.input_queue or '')
..(vis.recording and '@' or '') ..(vis.recording and '@' or '')
..'>')
-- syntax
table.insert(right_parts, win.syntax)
-- character under cursor -- character under cursor
table.insert(right_parts, table.insert(right_parts,
'<' '<'
..(string.byte(file:content(selection.pos, 1)) or '0') ..(string.byte(file:content(selection.pos, 1)) or '0')
..'>') ..'>')
-- line and column count
table.insert(right_parts, #file.lines..'/'..selection.line)
table.insert(right_parts, selection.col)
end end
table.insert(left_parts, file_info)
-- line and column count
table.insert(right_parts, #file.lines..'/'..selection.line)
table.insert(right_parts, selection.col)
-- fillchars -- fillchars
local left = table.concat(left_parts, ' ') local left = table.concat(left_parts, ' ')
local right = table.concat(right_parts, ' ') local right = table.concat(right_parts, ' ')