odyssomay / paredit

A paredit mode for lisps in Sublime Text.
104 stars 9 forks source link

Better ctrl+k #11

Closed mason-stewart closed 11 years ago

mason-stewart commented 11 years ago

In OS X, ctrl+k is a system-wide command for deleting from the cursor to the end of line, and ctrl+shift+k will kill the entire line. This was being overridden by the paredit_kill and paredit_kill_expression key-mappings. The paredit_kill and paredit_kill_expression commands are mega-helpful, but even in LISP, there are times that you may want to kill to the end of the line while not inside of an expression.

My solution was simply to check whether or not the cursor is inside of an expression before using Paredit's function. If you're outside of an expression, the normal behavior for your platform will occur.

Thanks!

xpe commented 11 years ago

@masondesu By "outside of an expression" do you mean a comment? Is there any other context?

mason-stewart commented 11 years ago

Hey @xpe! Specifically, I mean "not inside of any parens, curly or square brackets" when I say "outside of an expression". Does that make sense?

odyssomay commented 11 years ago

I implemented it in paredit-kill as I didn't want to rely on system behaviour. Also, paredit-kill removing to the end of the line outside an expression is part of the original paredit, so it makes sense to implement it.