-
-
Notifications
You must be signed in to change notification settings - Fork 163
Description
About this task
This issue started discussing a potential bug, and ended up evolving into a rundown of the ongoing work on org-roam.nvim, a plugin to implement Org-roam in neovim.
Scroll further down to see details about the plugin, code pointers and highlights, etc.
The original bug report is kept below for clarity.
Describe the bug
I am writing a plugin that creates some buffers with a buftype of nofile
. The purpose of these is to generate some immutable orgmode content that you can navigate. In particular, I want to take advantage of the fantastic folding that orgmode offers.
Unfortunately, when I go to collapse a section, I get an error about the current file is not found or not an org file, caused by
orgmode/lua/orgmode/files/init.lua
Line 106 in 261c987
assert(orgfile, 'Current file not found or not an org file') |
Steps to reproduce
- Create a scratch buffer via
vim.api.nvim_create_buf(false, true)
- Set the filetype to org via
vim.api.nvim_buf_set_option(bufnr, "filetype", "org")
- Populate with some org headings via
vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, {"* Heading 1-a", "** Heading 2", "* Heading 1-b"})
- Navigate to the buffer and hit tab to try to collapse or expand a section
Expected behavior
Section is properly folded.
Emacs functionality
No response
Minimal init.lua
-- Import orgmode using the minimal init example
Screenshots and recordings
No response
OS / Distro
MacOS 14.4
Neovim version/commit
0.9.5
Additional context
Using orgmode on master branch at commit 651078a.