org fold does not work when .org file is opened by telescope
i.e
keybindings like zM, zR, <Tab> do not work.
However, it is noted that if after opening the .org buffer by telescope, typing :e to refresh the buffer content will make the fold works
Steps to reproduce
nvim -u minimal-init.lua (note: don't directly open the org file at here)
Open an org file via :Telescope find_files or :Telescope oldfiles
go to a heading and typing <tab>
find that folding does not work
Expected behavior
Folding should work
Emacs functionality
folding should work
Minimal init.lua
vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
require('packer').startup {
{
'wbthomason/packer.nvim',
{ 'nvim-treesitter/nvim-treesitter' },
{ 'kristijanhusak/orgmode.nvim', branch = 'master' },
{ 'nvim-telescope/telescope.nvim' },
{ 'nvim-lua/plenary.nvim' },
},
config = {
package_root = package_root,
compile_path = install_path .. '/plugin/packer_compiled.lua',
},
}
end
_G.load_config = function()
require('orgmode').setup_ts_grammar()
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = { 'org' },
},
}
vim.cmd [[packadd nvim-treesitter]]
vim.cmd [[runtime plugin/nvim-treesitter.lua]]
vim.cmd [[TSUpdateSync org]]
-- Close packer after install
if vim.bo.filetype == 'packer' then
vim.api.nvim_win_close(0, true)
end
require('orgmode').setup()
require('telescope').setup()
end
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerCompileDone ++once lua load_config()]]
else
load_plugins()
_G.load_config()
end
Screenshots and recordings
OS / Distro
macOS
Neovim version/commit
0.8
Additional context
This is a duplicate of #131. However since that issue was a stale issue and had outdated for a long time.
I think it is better to reopen the issue at here.
Describe the bug
org fold does not work when
.org
file is opened bytelescope
i.e
keybindings like
zM
,zR
,<Tab>
do not work.However, it is noted that if after opening the
.org
buffer by telescope, typing:e
to refresh the buffer content will make the fold worksSteps to reproduce
:Telescope find_files
or:Telescope oldfiles
<tab>
Expected behavior
Folding should work
Emacs functionality
folding should work
Minimal init.lua
Screenshots and recordings
OS / Distro
macOS
Neovim version/commit
0.8
Additional context
This is a duplicate of #131. However since that issue was a stale issue and had outdated for a long time. I think it is better to reopen the issue at here.