<CR> does not break a line with latest commit
Describe the bug
The latest commit seems to have broken the functionality of the <CR> in insert mode. Previously, a <CR> would insert a new line. But since the latest commit 35f4fb6 a new function has been mapped to <CR> called org_return as we can see from here.
Steps to reproduce
- Update to the latest commit 35f4fb6
- Start nvim with the minimal configuration
- Open an org file
- Enter insert mode, try to add a new line by pressing
<CR> - No new line is added.
Expected behavior
The <CR> should add a new line in insert mode. Otherwise, we should document this unexpected behavior and instruct the user on how to modify it.
It is possible to have the previous behavior by modifing the settings with:
require'orgmode'.setup {
mappings = {
org = {
org_return = '',
},
},
}
Emacs functionality
N/A
Minimal init.lua
See https://gist.github.com/kristijanhusak/a0cb5f4eb2bad3e732a1d18d311ebe2f
Screenshots and recordings
No response
OS / Distro
Ubuntu 20.04
Neovim version/commit
0.7.0
Additional context
No response
This should be fixed now. I didn't consider an empty string as falsy value.
Hey! Thanks for fixing this. The latest version sadly triggers this behavior for me now: https://github.com/windwp/nvim-autopairs/issues/93
It doesn't seem to be an issue of autopairs though I'm not really sure. It seems the mappigns are somehow battling each other.
Only if I remove the org_return mapping like in the comment above it works again. Maybe this comment can be helpful in solving this: https://github.com/windwp/nvim-autopairs/issues/93#issuecomment-998443134
I'm sorry I would like to be able to help more but for now all I can do is report this :(
@chmanie I just pushed some changes that should fix it. Can you give it a test?
Hey @kristijanhusak! Thanks, that does solve the issue. Only now the text that was pasted in the buffer before now flashes in the statusline every time I press enter. I can upload a video if that helps (I incidentally had OBS open).
@chmanie please provide the video
@kristijanhusak here it is. Hope the quality is good enough to see what I mean
https://user-images.githubusercontent.com/2174084/171058191-be164dea-c440-4cd9-98fc-4e747da3cfa0.mp4
@chmanie I see what you mean. Pull latest master and see if I managed to fix it.
Yes, it's fixed! Thank you so much :tada:
I was experiencing a similar issue with another plugin (Autoclose) and I thought it would be helpful to bring this.
@compiledge could you please provide a video or a more detailed description of the issue you have? Thanks!
Describe the bug
It is not possible to break lines in "insert" mode when the orgmode plug-in is used with the autoclose plug-in.
Expected behaviour
The <cr> should add a new line in insert mode.

Standard configuration
use {
'nvim-orgmode/orgmode',
requires = {{'nvim-treesitter/nvim-treesitter'}},
config = function()
require('orgmode').setup_ts_grammar()
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = {'org'},
}
}
require('orgmode').setup{
org_agenda_files = {'~/git/org/*'},
org_default_notes_file = '~/git/org/refile.org',
}
end
}
Emacs functionality
N/A
Nvim version
v0.8.2
Nvim-orgmode latest commit
#528
Conflict plug-in:
Autoclose: It's possible that the plug-in is doing some general mapping to the <cr> key.
Solution:
Migrate to another software that does the same solution. In this case, the autopair plug-in.
@compiledge this issue should've been solved by now. Can you double check, please?
@kristijanhusak
@compiledge this issue should've been solved by now. Can you double check, please?
I still have the same issue when using autoclose along with nvim-orgmode where the return key does not create a new line. I chose to just switch to another plugin that does the same thing as autoclose.
EDIT: Scratch that, I'm an idiot. I was using just regular return instead of the cr key. It works form me when using carriage return.
I'm closing this as inactive. If there any other problems, open another issue.