-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(barf): move the point with the barfed delimiter
Fix #918
- Loading branch information
Showing
4 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
(require 'smartparens) | ||
|
||
(ert-deftest sp-test-sp-forward-barf-sexp-634 () | ||
(let ((sp-barf-move-point-with-delimiter nil)) | ||
(sp-test-with-temp-elisp-buffer "(let ((a 4)\n ;; (fail)\n |(+ 1)\n ))\n" | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(let ((a 4))\n ;; (fail)\n (+ 1)\n )\n") | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(let ((a 4)))\n;; (fail)\n|(+ 1)\n\n")))) | ||
|
||
(ert-deftest sp-test-sp-forward-barf-918-move-point-with-closing-enabled () | ||
(let ((sp-barf-move-point-with-delimiter t)) | ||
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)" | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(hello world\n\n | what\n is) this") | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(hello world\n\n | what)\nis this") | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(hello world|)\n\nwhat\nis this")))) | ||
|
||
(ert-deftest sp-test-sp-forward-barf-918-move-point-with-closing-disabled () | ||
(let ((sp-barf-move-point-with-delimiter nil)) | ||
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)" | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(hello world\n\n | what\n is) this") | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(hello world\n\n | what)\nis this") | ||
(call-interactively 'sp-forward-barf-sexp) | ||
(sp-buffer-equals "(hello world)\n\n|what\nis this")))) | ||
|
||
(ert-deftest sp-test-sp-backward-barf-918-move-point-with-opening-enabled () | ||
(let ((sp-barf-move-point-with-delimiter t)) | ||
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)" | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello (world\n\n | what\n is this)") | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello world\n\n(|what\n is this)") | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello world\n\nwhat\n(|is this)")))) | ||
|
||
(ert-deftest sp-test-sp-backward-barf-918-move-point-with-opening-enabled-with-prefix () | ||
(let ((sp-barf-move-point-with-delimiter t)) | ||
(sp-test-with-temp-elisp-buffer ",@(hello world\n\n | what\n is this)" | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello ,@(world\n\n | what\n is this)") | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello world\n\n,@(|what\n is this)") | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello world\n\nwhat\n,@(|is this)")))) | ||
|
||
(ert-deftest sp-test-sp-backward-barf-918-move-point-with-opening-disabled () | ||
(let ((sp-barf-move-point-with-delimiter nil)) | ||
(sp-test-with-temp-elisp-buffer "(hello world\n\n | what\n is this)" | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello (world\n\n | what\n is this)") | ||
(call-interactively 'sp-backward-barf-sexp) | ||
(sp-buffer-equals "hello world\n\n|(what\n is this)")))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters