Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hit Cmd-Enter in list/ul for new line without bullet #157

Open
joallard opened this issue Nov 14, 2016 · 1 comment
Open

Hit Cmd-Enter in list/ul for new line without bullet #157

joallard opened this issue Nov 14, 2016 · 1 comment

Comments

@joallard
Copy link

joallard commented Nov 14, 2016

As a hard wrap user, something that annoys me is hitting 'Enter' when in a list to hard wrap a long list item, and getting another bullet instead.

Is there a way to make it so Cmd-Enter/Ctrl-Enter can be interpreted as "just a newline" and not produce a bullet, like in other editors?

If so, I'd be glad to implement it, if you could just tell me where to look.

[enhancement]

@burodepeper
Copy link
Owner

That shouldn't be too difficult. What you are looking for starts here. Opposed to the others commands, this works by observing if a newline character is added to the buffer. You could add a condition that checks if there are no secondary keys pressed/attached to that event. Don't know the API for that by memory, but the Inspector can help you out there.

The reason that this is not tied to a keymapping, is because this automatically deals with indentation issues. Note to self: add a comment about this in the code. There's an attempt at working around this (mainly due to multi-cursor issues) in a different branch, but I ran into some other issues there, so I've abandoned it for another time.

My biggest concern is overwriting any expected default behavior of an enter-keycombo. cmd+enter already has a function (it acts as inserting a line-break at the end of the line, even if you're at the beginning), which I assume maps to ctrl+enter on other systems. So only shift+enter and alt+enter are an option. If there is no behavior attached to those, feel free to target that. If there is however, and I kind of assume there is, then you'll need to hide it behind a setting and make sure it doesn't interfere with other stuff.

Let me know if you need additional info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants