orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

<CR> does not break a line with latest commit

Open gzagatti opened this issue 3 years ago • 12 comments

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

  1. Update to the latest commit 35f4fb6
  2. Start nvim with the minimal configuration
  3. Open an org file
  4. Enter insert mode, try to add a new line by pressing <CR>
  5. 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

gzagatti avatar May 30 '22 05:05 gzagatti

This should be fixed now. I didn't consider an empty string as falsy value.

kristijanhusak avatar May 30 '22 11:05 kristijanhusak

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 avatar May 30 '22 13:05 chmanie

@chmanie I just pushed some changes that should fix it. Can you give it a test?

kristijanhusak avatar May 30 '22 16:05 kristijanhusak

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 avatar May 30 '22 17:05 chmanie

@chmanie please provide the video

kristijanhusak avatar May 30 '22 19:05 kristijanhusak

@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 avatar May 30 '22 20:05 chmanie

@chmanie I see what you mean. Pull latest master and see if I managed to fix it.

kristijanhusak avatar May 31 '22 08:05 kristijanhusak

Yes, it's fixed! Thank you so much :tada:

chmanie avatar May 31 '22 09:05 chmanie

I was experiencing a similar issue with another plugin (Autoclose) and I thought it would be helpful to bring this.

compiledge avatar Mar 18 '23 22:03 compiledge

@compiledge could you please provide a video or a more detailed description of the issue you have? Thanks!

jgollenz avatar Mar 19 '23 11:03 jgollenz

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. cr-problem

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 avatar Mar 21 '23 19:03 compiledge

@compiledge this issue should've been solved by now. Can you double check, please?

kristijanhusak avatar Jun 09 '23 14:06 kristijanhusak

@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.

3rgoProxy avatar Feb 22 '24 04:02 3rgoProxy

I'm closing this as inactive. If there any other problems, open another issue.

kristijanhusak avatar Feb 25 '24 16:02 kristijanhusak