Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions features/m-c-commands.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: M-C- commands
Background:
Given I am in buffer "god-mode-test"
And the buffer is empty
And I insert "Here we go"
Then I have god-mode on

Scenario: mark is preserved
Given I go to beginning of buffer
And I bind "C-SPC" to "set-mark-command"
When I send the key sequence "SPC gfGf"
Then region's contents should be "Here we"



8 changes: 8 additions & 0 deletions features/step-definitions/god-mode-steps.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,11 @@ Examples:
(let ((actual (buffer-string))
(message "Expected buffer's contents to contain '%s', but was '%s'"))
(cl-assert (s-contains? expected actual) nil message expected actual))))

(Then "^region's contents should be\\(?: \"\\(.+\\)\"\\|:\\)$"
"Asserts that the current region inclues some text."
(lambda (expected)
(let ((actual (buffer-substring-no-properties
(region-beginning) (region-end)))
(message "Expected region's contents to be '%s', but was '%s'"))
(cl-assert (s-equals? expected actual) nil message expected actual))))
2 changes: 1 addition & 1 deletion god-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ If it was not active when `god-local-mode-pause' was called, nothing happens."
(defun god-mode-upper-p (key)
"Check if KEY is an upper case character not present in `god-mode-alist'."
(and (characterp key)
(not (member key (mapcar #'car god-mode-alist)))
(not (member (char-to-string key) (mapcar #'car god-mode-alist)))
(>= key ?A)
(<= key ?Z)))

Expand Down