chore: autogen (vimdocs+formating)
This commit is contained in:
parent
253a656ca5
commit
1af8c67257
|
@ -251,6 +251,7 @@ CHANGING COMPONENTS IN LUALINE SECTIONS ~
|
||||||
- `mode` (vim mode)
|
- `mode` (vim mode)
|
||||||
- `progress` (%progress in file)
|
- `progress` (%progress in file)
|
||||||
- `searchcount` (number of search matches when hlsearch is active)
|
- `searchcount` (number of search matches when hlsearch is active)
|
||||||
|
- `selectioncount` (number of selected characters or lines)
|
||||||
- `tabs` (shows currently available tabs)
|
- `tabs` (shows currently available tabs)
|
||||||
- `windows` (shows currently available windows)
|
- `windows` (shows currently available windows)
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
local function selectioncount()
|
local function selectioncount()
|
||||||
local mode = vim.fn.mode(true)
|
local mode = vim.fn.mode(true)
|
||||||
local line_start, col_start = vim.fn.line("v"), vim.fn.col("v")
|
local line_start, col_start = vim.fn.line('v'), vim.fn.col('v')
|
||||||
local line_end, col_end = vim.fn.line("."), vim.fn.col(".")
|
local line_end, col_end = vim.fn.line('.'), vim.fn.col('.')
|
||||||
if mode:match("") then
|
if mode:match('') then
|
||||||
return string.format('%dx%d', math.abs(line_start-line_end)+1, math.abs(col_start-col_end)+1)
|
return string.format('%dx%d', math.abs(line_start - line_end) + 1, math.abs(col_start - col_end) + 1)
|
||||||
elseif mode:match("V") or line_start ~= line_end then
|
elseif mode:match('V') or line_start ~= line_end then
|
||||||
return math.abs(line_start - line_end) + 1
|
return math.abs(line_start - line_end) + 1
|
||||||
elseif mode:match("v") then
|
elseif mode:match('v') then
|
||||||
return math.abs(col_start - col_end) + 1
|
return math.abs(col_start - col_end) + 1
|
||||||
else
|
else
|
||||||
return ''
|
return ''
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue