lisp-paredit icon indicating copy to clipboard operation
lisp-paredit copied to clipboard

Enter key not working

Open yochannah opened this issue 9 years ago • 12 comments

For reasons I can't explain, lisp-paredit won't respond to the enter key. The enter key works fine outside Atom or with lisp-paredit disabled.

The tricky bit: I have no idea how to reproduce this bug.

Atom version 1.4.0 (highest available through my package manager at the moment)
Ubuntu 14.04.3 LTS Lisp-paredit 0.5.2

yochannah avatar Jan 27 '16 12:01 yochannah

A few questions: Does it not respond at all or is it an intermittent problem? Did it start happening today or beforehand? Are there any errors in the console (View -> Developer -> Toggle Developer Tools) after it occurs?

jonspalding avatar Jan 27 '16 13:01 jonspalding

Wow, thanks for the fast response! It doesn't respond at all, anywhere in the document. It started happening last week, round about Thursday 21st Jan.

Nothing at all appears in the console when I intentionally trigger the error.

yochannah avatar Jan 27 '16 13:01 yochannah

ok, I have figured it out! The package itself was enabled, but in the lisp-paredit settings, somehow the "Enabled " had become unchecked. A colleague of mine was able to reproduce the same behaviour.

image

yochannah avatar Jan 27 '16 14:01 yochannah

Is it only lisp documents affected?

One thing you can do is turn on the keybinding resolver (Cmd-. on Mac, probably Ctrl-. on linux) then hit enter. Do you see the lisp-paredit:newline command at the top? Something like this keybinds.

jonspalding avatar Jan 27 '16 14:01 jonspalding

Ok thanks, sounds like a bug in the enable toggle.

jonspalding avatar Jan 27 '16 14:01 jonspalding

I was able to resolve by going to settings > core > Packages with Keymaps Disabled > *removed lisp-paredit. Thsi got me the indentation back correctly. screen shot 2016-04-16 at 9 01 31 pm

indigo0086 avatar Apr 17 '16 04:04 indigo0086

What is the status on this one? I am also having this issue. I can't find the Packages With Keymaps Disabled option in Atom 1.7.4 settings any more - has it been removed?

naartjie avatar Jun 04 '16 12:06 naartjie

I have a problem similar to the above when editing a .lisp file:

  • With lisp-paredit enabled the Enter key correctly inserts a newline but the cursor immediately goes to the start of the previous line.
  • With lisp-paredit toggled off, the Enter key does not work at all.

In both cases, the key binding resolver shows "lisp-paredit-newline" in green when I press the Enter key.

On a regular (non Lisp) file, the Enter key works normally and the key binding resolver shows "editor:newline" (same behaviour with lisp-paredit toggled on or off).

Adrien79 avatar Mar 13 '17 19:03 Adrien79

@Adrien79 I have the same problem, did you find a solution?

Edit: For the record, I found the solution in my case, so simple... In case you are using Windows too, just alter the line ending to CRLF! 😆

Thanks

gibranrosa avatar Jun 07 '17 14:06 gibranrosa

I was having a similar issue on windows. Where | is the cursor location.

(do something
  something)|

Pressing enter while using CRLF results in:

(do something
  something)|
; NEW LINE CREATED with no indent, but cursor remains upper line

And the cursor doesn't move. Changing to LF endings works much better resulting in

(do something
  something)
|

Inside the () works well in either mode.

eskemojoe007 avatar Mar 14 '19 20:03 eskemojoe007

Same problem on windows. Looks like line ending issue. Also, probably the same issue, the delete key does not work in that situation at the end of the line.

uUJsd7PX avatar Jul 29 '19 07:07 uUJsd7PX

The issue describes my the newer comments relates to assumptions about line endings in the underlying paredit.js library. Specifically, in the indentRange function. Changing the split regex to /\r\n|[\n\v\f\r\x85\u2028\u2029]/ partially helps, but there are still some indexing issues that I haven't figured out yet.

Relatedly, the delete key issue comes from trying to delete a single character, but needing to delete a pair of characters.

neil-lindquist avatar Apr 18 '20 17:04 neil-lindquist