Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
org_indent_mode_turns_off_org_adapt_indentation
See nvim-orgmode#627 (review) > I gave it a test, it works great, and code looks good overall. I only noticed one inconsistency. > > If `org_startup_indented = true` and `org_adapt_indentation = true`, when I open up the file and reindent the file, it doesn't change any indentation. > > For example, I have this content that is hard indented: > > ``` > * TODO Test > Test > List > - First > - second > - level2 > - level3 > - level2 item > ``` > > Now when I apply above configuration (setting both to `true`) and open it, I get this: > > virtual indent + hard indent: > > ``` > * TODO Test > Test > List > - First > - second > - level2 > - level3 > - level2 item > ``` > > This is working as expected. But now, if I do gg=G, no indentation is actually changed. I would expect to realign everything so it adapts to the virtual indentation. It does that when `org_adapt_indentation = false`, so it generally works. We just need to tweak the checks. > > AFAIK Emacs doesn't have this idea of (hard) reindentation, so this is something we can figure out ourselves. > > If we follow the default Emacs settings for org indent mode I mentioned previously [link](https://orgmode.org/manual/Org-Indent-Mode.html#:~:text=By%20default%2C%20Org%20Indent%20mode%20turns%20off%20org%2Dadapt%2Dindentation), which states that when org-indent-mode is enabled on buffer, it disables the `org-adapt-indentation`, we can expect to apply the reindentation logic I mentioned above. > > So `org_startup_indented` always has higher priority over `org_adapt_indentation`, until we maybe introduce `org_indent_mode_turns_off_org_adapt_indentation` mentioned [here](https://orgmode.org/manual/Org-Indent-Mode.html#:~:text=If%20you%20want%20to%20customize%20this%20default%20behavior%2C%20see%20org%2Dindent%2Dmode%2Dturns%2Don%2Dhiding%2Dstars%20and%20org%2Dindent%2Dmode%2Dturns%2Doff%2Dorg%2Dadapt%2Dindentation.), but we'll leave that as an improvement for later.
- Loading branch information