Skip to content

Commit

Permalink
Toggle deferred without moving point.
Browse files Browse the repository at this point in the history
  • Loading branch information
magnars committed Jun 16, 2012
1 parent e83c319 commit 6fb1cf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions buster-mode.el
Expand Up @@ -3,11 +3,12 @@


(defun buster-toggle-deffered () (defun buster-toggle-deffered ()
(interactive) (interactive)
(buster-goto-current-test) (save-excursion
(forward-char 1) (buster-goto-current-test)
(if (looking-at "//") (forward-char 1)
(delete-char 2) (if (looking-at "//")
(insert "//"))) (delete-char 2)
(insert "//"))))


(defvar buster-mode-map (make-sparse-keymap) (defvar buster-mode-map (make-sparse-keymap)
"buster-mode keymap") "buster-mode keymap")
Expand Down
3 changes: 2 additions & 1 deletion features/buster-mode.feature
Expand Up @@ -3,7 +3,7 @@ Feature: Toggle deferred
As a buster using emacs user As a buster using emacs user
I want to just press key please I want to just press key please


Scenario: Deferring a test Scenario: Attempting to defer test outside buster-mode
When I insert: When I insert:
""" """
buster.testCase('Building Page', { buster.testCase('Building Page', {
Expand All @@ -29,6 +29,7 @@ Feature: Toggle deferred
And I go to the front of the word "assert" And I go to the front of the word "assert"
And I press "C-c C-b td" And I press "C-c C-b td"
Then I should see "//contains" Then I should see "//contains"
And the cursor should be before "assert"


Scenario: Undeferring a test Scenario: Undeferring a test
When I insert: When I insert:
Expand Down

0 comments on commit 6fb1cf1

Please sign in to comment.