orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

NeoVim OrgMode file startup Error

Open ps1ph1 opened this issue 2 years ago • 6 comments

Describe the bug

When opening up a org file I get the following error message

Error detected while processing FileType Autocommands for "org": Error executing lua callback: Vim:E730: using List as a String stack traceback: [C]: in function 'expand' ....config/nvim/plugged/orgmode/lua/orgmode/config/init.lua:73: in function 'get_all_files' ...config/nvim/plugged/orgmode/lua/orgmode/parser/files.lua:24: in function 'load' ...config/nvim/plugged/orgmode/lua/orgmode/parser/files.lua:19: in function 'new' ...jbwalt/.config/nvim/plugged/orgmode/lua/orgmode/init.lua:28: in function 'init' ...jbwalt/.config/nvim/plugged/orgmode/lua/orgmode/init.lua:44: in function 'reload' ...jbwalt/.config/nvim/plugged/orgmode/lua/orgmode/init.lua:61: in function <...jbwalt/.config/nvim/plugged/orgmod e/lua/orgmode/init.lua:60>

If I hit Enter, the error keeps on appearing

Steps to reproduce

nvim example.org

Then the error appears

Expected behavior

It should place me in the org file without any errors

Emacs functionality

No response

Minimal init.lua

-- Load custom tree-sitter grammar for org filetype require('orgmode').setup_ts_grammar()

require'nvim-treesitter.configs'.setup { ensure_installed = { "org", "bash", "ledger", "regex", "sql" }, highlight = { enable = true }, additional_vim_regex_highlighting = {'org'}, }

require('orgmode').setup({ -- win_split_mode = {'float'}, -- org_indent_mode = {'indent'}, -- org_tags_column = {'-80'}, org_agenda_files = {'~/docz/notes/*'}, org_default_notes_file = {'~/docz/notes/notez.org'}, org_capture_templates = { j = { description = 'Journal', template = '%?\n %U', target = '~/docz/notes/journal.org' },

                                                                            q = {
                                                                            description = 'Quick-Note',
                                                                            template = '%?\n %f-%U',
                                                                            target = '~/docz/notes/refile.org'
                                                                            }
                                                                    }

})

Screenshots and recordings

No response

OS / Distro

macOs 12.3.1

Neovim version/commit

NVIM v0.7.2 Build type: Release LuaJIT 2.1.0-beta3 Compiled by brew@Monterey

Additional context

No response

ps1ph1 avatar Jul 18 '22 21:07 ps1ph1

@ps1ph1 please wrap your minimal_init.lua in two lines of only triple backticks ```, so it will be formatted properly. To get lua syntax highlighting, add 'lua' to your first backtick line: ```lua

jgollenz avatar Jul 19 '22 09:07 jgollenz

lua << EOF
-- Load custom tree-sitter grammar for org filetype
require('orgmode').setup_ts_grammar()

-- Tree-sitter configuration
require'nvim-treesitter.configs'.setup {
   highlight = {
		enable = true ,
		additional_vim_regex_highlighting = {'org'},
	},
   ensure_installed = { "org", "bash", "ledger", "regex", "sql" },
}

require('orgmode').setup({
--  win_split_mode = {'float'},
 --  org_indent_mode = {'indent'},
--  org_tags_column = {'-80'},
  org_agenda_files = {'~/docz/notes/*'},
  org_default_notes_file = {'~/docz/notes/notez.org'},
  org_capture_templates = {
		j = {
		description = 'Journal',
		template = '%?\n  %U',
		target = '~/docz/notes/journal.org'
	},

		q = {
	 	description = 'Quick-Note',
	 	template = '%?\n %f-%U',
	 	target = '~/docz/notes/refile.org'
		}
	}
})

ps1ph1 avatar Jul 20 '22 12:07 ps1ph1

Error message

Error executing vim.schedule lua callback: .../plugged/orgmode/lua/orgmode/colors/todo_highlighter.lua:55: Vim(append):Error e
xecuting lua callback: Vim:E730: using List as a String
stack traceback:
        [C]: in function 'expand'
        ....config/nvim/plugged/orgmode/lua/orgmode/config/init.lua:73: in function 'get_all_files'
        ...config/nvim/plugged/orgmode/lua/orgmode/parser/files.lua:24: in function 'load'
        ...config/nvim/plugged/orgmode/lua/orgmode/parser/files.lua:19: in function 'new'
        ...jbwalt/.config/nvim/plugged/orgmode/lua/orgmode/init.lua:28: in function 'init'
        ...jbwalt/.config/nvim/plugged/orgmode/lua/orgmode/init.lua:44: in function 'reload'
        ...jbwalt/.config/nvim/plugged/orgmode/lua/orgmode/init.lua:61: in function <...jbwalt/.config/nvim/plugged/orgmode/lu
a/orgmode/init.lua:60>
        [C]: in function 'cmd'
        .../plugged/orgmode/lua/orgmode/colors/todo_highlighter.lua:55: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
stack traceback:
        [C]: in function 'cmd'
        .../plugged/orgmode/lua/orgmode/colors/todo_highlighter.lua:55: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue

ps1ph1 avatar Jul 20 '22 12:07 ps1ph1

Thanks! Did you try different files? Have you been able to open an org file successfully before? If it's just a certain file that fails, it would be great if you could share its contents

jgollenz avatar Jul 20 '22 13:07 jgollenz

This is my first time using neovim org-mode. I used emacs orgmode before but saw there was a variant for Neovim so decided to give it a try.

I get this error no matter what type of file. I even tried it with a new file and still got the same error message. I even tried to open a blank file and still got the same error message.

Are there any plugins that may interfere with org-mode loading correctly?

ps1ph1 avatar Jul 20 '22 18:07 ps1ph1

Could you please run nvim -u <path-to-orgmode-repo>/scripts/minimal_init.lua <your-test-file> for a quick sanity check? If that works, it's possible that some other plugin is interfering with orgmode

jgollenz avatar Jul 21 '22 10:07 jgollenz

@kristijanhusak Not sure this is exactly the same bug, but I think vim-orgmode might be trying to execute (part of) the headline. Try to open the following file:

* vim: do 

The error I get is

Error executing vim.schedule lua callback: ...ged/orgmode.nvim/lua/orgmode/colors/todo_highlighter.lua:55: Vim(filetype):E518: Unknown option: do
stack traceback:
        [C]: in function 'cmd'
        ...ged/orgmode.nvim/lua/orgmode/colors/todo_highlighter.lua:55: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

This only happens if there's something with vim: in the headline

Maltimore avatar Sep 08 '22 20:09 Maltimore

@Maltimore I pushed the fix for your issue. Vim was reading that as a modeline (see :help modeline). I disabled modelines in org buffers now.

@ps1ph1 your issue is with the default notes file. It needs to be a string, not table.

kristijanhusak avatar Sep 10 '22 13:09 kristijanhusak

Thanks a lot, didn't know about modelines. The fix works perfectly also!

Maltimore avatar Sep 10 '22 17:09 Maltimore

Closing this due to inactivity.

kristijanhusak avatar Sep 13 '22 17:09 kristijanhusak