Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c69245e

Browse files
feat(folds): Add option to use old folds highlights
1 parent e91b94c commit c69245e

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

DOCS.md

+16
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
9. [User interface](#user-interface)
2424
1. [Colors](#colors)
2525
2. [Menu](#menu)
26+
3. [Folds](#folds)
2627
10. [Advanced search](#advanced-search)
2728
11. [Notifications (experimental)](#notifications-experimental)
2829
12. [Clocking](#clocking)
@@ -1859,6 +1860,21 @@ Each menu item `MenuItem` is one of two types: `MenuOption` and `MenuSeparator`.
18591860

18601861
In order for the menu to work as expected, the handler must call `action` from `MenuItem`.
18611862

1863+
### Folds
1864+
In Neovim 0.10+, folds are colored with the same highlight as when they are expanded.
1865+
This is enabled by default to be in line with how Emacs work.
1866+
1867+
To use the old way of highlighting folds with `Folded` highlight group, add this to config:
1868+
```lua
1869+
require('orgmode').setup({
1870+
ui = {
1871+
folds = {
1872+
colored = false
1873+
}
1874+
}
1875+
})
1876+
```
1877+
18621878
## Advanced search
18631879

18641880
Part of [Advanced search](https://orgmode.org/worg/org-tutorials/advanced-searching.html) functionality

ftplugin/org.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ vim.bo.modeline = false
2424
vim.opt_local.fillchars:append('fold: ')
2525
vim.opt_local.foldmethod = 'expr'
2626
vim.opt_local.foldexpr = 'v:lua.require("orgmode.org.fold").foldexpr()'
27-
if utils.has_version_10() then
27+
if utils.has_version_10() and config.ui.folds.colored then
2828
vim.opt_local.foldtext = ''
2929
else
3030
vim.opt_local.foldtext = 'v:lua.require("orgmode.org.indent").foldtext()'

lua/orgmode/config/defaults.lua

+3
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ local DefaultConfig = {
200200
config_path = '$HOME/.emacs.d/init.el',
201201
},
202202
ui = {
203+
folds = {
204+
colored = true,
205+
},
203206
menu = {
204207
handler = nil,
205208
},

0 commit comments

Comments
 (0)