vis: rework statusline
parent
3dc0c6a102
commit
852aeb11f3
|
@ -83,39 +83,39 @@ e.subscribe(e.WIN_STATUS, function(win)
|
|||
local file = win.file
|
||||
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
|
||||
-- mode
|
||||
table.insert(left_parts, mode_strings[vis.mode])
|
||||
table.insert(left_parts, 1, mode_strings[vis.mode])
|
||||
|
||||
-- selection
|
||||
table.insert(left_parts, selection.number..'/'..#win.selections)
|
||||
-- syntax
|
||||
table.insert(left_parts, win.syntax)
|
||||
|
||||
-- file info
|
||||
file_info =
|
||||
file_info
|
||||
..':'
|
||||
-- input info
|
||||
table.insert(left_parts,
|
||||
'<'
|
||||
..(vis.count or '')
|
||||
..(vis.input_queue or '')
|
||||
..(vis.recording and '@' or '')
|
||||
|
||||
-- syntax
|
||||
table.insert(right_parts, win.syntax)
|
||||
..'>')
|
||||
|
||||
-- character under cursor
|
||||
table.insert(right_parts,
|
||||
'<'
|
||||
..(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
|
||||
|
||||
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
|
||||
local left = table.concat(left_parts, ' ')
|
||||
local right = table.concat(right_parts, ' ')
|
||||
|
|
Loading…
Reference in New Issue