Debian Codegraph @

lua/lualine/components/progress.lua

raw
1 -- Copyright (c) 2020-2021 hoob3rt
2 -- MIT license, see LICENSE for more details.
3 local function progress()
4 local cur = vim.fn.line('.')
5 local total = vim.fn.line('$')
6 if cur == 1 then
7 return 'Top'
8 elseif cur == total then
9 return 'Bot'
10 else
11 return string.format('%2d%%%%', math.floor(cur / total * 100))
12 end
13 end
14
15 return progress