Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

feat: Added macro provider #324

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ Feline by default has some built-in providers to make your life easy. They are:
| `line_percentage` | Current line percentage |
| [`scroll_bar`](#scroll-bar) | Scroll bar that shows file progress |
| [`search_count`](#search-count) | Search count for current search |
| `macro` | Shows macro being recorded |
| [`file_info`](#file-info) | Get file icon, name and modified status |
| `file_size` | Get file size |
| `file_type` | Get file type |
Expand Down
9 changes: 9 additions & 0 deletions lua/feline/providers/cursor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,13 @@ function M.search_count()
return string.format('[%d/%d]', result.current, math.min(result.total, result.maxcount))
end

function M.macro()
local recording_register = vim.fn.reg_recording()
if recording_register == '' then
return ''
else
return 'Recording @' .. recording_register
end
end

return M
1 change: 1 addition & 0 deletions lua/feline/providers/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local get_provider_category = {
line_percentage = 'cursor',
scroll_bar = 'cursor',
search_count = 'cursor',
macro = 'cursor',

file_info = 'file',
file_size = 'file',
Expand Down