Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
- removes some leftovers
- fixes a typo
  • Loading branch information
NicolasPetton committed Sep 3, 2014
1 parent c74045b commit 5d45eda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion features/js2r-kill.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature: Killing lines
//}
"""

Scenario: Killing a with parse errors
Scenario: Killing a line with parse errors
When I insert:
"""
function foo(
Expand Down
16 changes: 7 additions & 9 deletions js2r-paredit.el
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Falls back to `kill-line` if the buffer has parse errors."
"Kill a line, but respecting the closest sexp, delimited with
\")}]\"."
(condition-case error
(let* ((node (js2-node-at-point))
(beg (point))
(let* ((beg (point))
(end (save-excursion
(up-list)
(forward-char -1)
Expand All @@ -50,13 +49,12 @@ array, literal object or string node)."
(progn
(message "Buffer has parse errors. Killing the line.")
(kill-line))
(let ((node (js2-node-at-point)))
(let* ((node (js2r--closest #'js2r--balanced-node-p))
(beg (point))
(end (and node (1- (js2-node-abs-end node)))))
(if (and node (js2-same-line end))
(kill-region beg end)
(kill-line))))))
(let* ((node (js2r--closest #'js2r--balanced-node-p))
(beg (point))
(end (and node (1- (js2-node-abs-end node)))))
(if (and node (js2-same-line end))
(kill-region beg end)
(kill-line)))))

(defun js2r-forward-slurp ()
(interactive)
Expand Down

0 comments on commit 5d45eda

Please sign in to comment.