Skip to content

Commit

Permalink
Merge branch 'patch-01'
Browse files Browse the repository at this point in the history
  • Loading branch information
rejeep committed Jan 13, 2014
2 parents b297349 + f591c00 commit f4d1aba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions features/string-to-symbol.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,11 @@ Feature: String To Symbol
And I press "C-:"
Then I should see ":"
And the cursor should be after ":"

Scenario: Turn one character string to symbol
When I insert "'s'"
And I turn on ruby-mode
And I go to character "s"
And I press "C-:"
Then I should see ":s"
And the cursor should be after "s"
2 changes: 1 addition & 1 deletion ruby-tools.el
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
(min (nth 0 region))
(max (nth 1 region))
(content (buffer-substring-no-properties (1+ min) (1- max))))
(when (string-match-p "^\\([a-ZA-Z_][a-ZA-Z0-9_]+\\)?$" content)
(when (string-match-p "^\\([a-ZA-Z_][a-ZA-Z0-9_]*\\)?$" content)
(let ((orig-point (point)))
(delete-region min max)
(insert (concat ":" content))
Expand Down

0 comments on commit f4d1aba

Please sign in to comment.