Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added wrap for headline icons #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ use {"akinsho/org-bullets.nvim", config = function()
require("org-bullets").setup {
concealcursor = false, -- If false then when the cursor is on a line underlying characters are visible
symbols = {
-- default: do not repeat the headlines list. use first icon only after all used once.
wrap = false,
-- list symbol
list = "•",
-- headlines can be a list
Expand Down
9 changes: 8 additions & 1 deletion lua/org-bullets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local list_groups = {
---@field public indent? boolean
local defaults = {
symbols = {
wrap = false,
list = "•",
headlines = { "◉", "○", "✸", "✿" },
checkboxes = {
Expand Down Expand Up @@ -73,7 +74,13 @@ local markers = {
if not symbols then
return false
end
local symbol = add_symbol_padding((symbols[level] or symbols[1]), level, conf.indent)
local symbol
if not conf.symbols.wrap then
symbol = add_symbol_padding((symbols[level] or symbols[1]), level, conf.indent)
else
local symbolIndex = ((level - 1) % #symbols) + 1
symbol = add_symbol_padding(symbols[symbolIndex], level, conf.indent)
end
local highlight = org_headline_hl .. level
return { { symbol, highlight } }
end,
Expand Down