Skip to content

Commit

Permalink
Do not decide if in a string or symbol by checking the face.
Browse files Browse the repository at this point in the history
  • Loading branch information
rejeep committed Apr 6, 2012
1 parent a980c4b commit 9d52cf7
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ruby-tools.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -103,19 +103,14 @@
"Check if cursor is at a symbol or not." "Check if cursor is at a symbol or not."
(and (and
(not (ruby-tools-string-at-point-p)) (not (ruby-tools-string-at-point-p))
(or (looking-at "[A-Za-z0-9_]+")
(memq 'font-lock-constant-face (text-properties-at (point))) (looking-back ":[A-Za-z0-9_]*")))
(and
(looking-at "[A-Za-z0-9_]+")
(looking-back ":[A-Za-z0-9_]*")))))


(defun ruby-tools-string-at-point-p () (defun ruby-tools-string-at-point-p ()
"Check if cursor is at a string or not." "Check if cursor is at a string or not."
(or (and
(memq 'font-lock-string-face (text-properties-at (point))) (looking-at "[^\"']+['\"]")
(and (looking-back "['\"][^\"']*")))
(looking-at "[^\"']+['\"]")
(looking-back "['\"][^\"']*"))))


(defun ruby-tools-symbol-region () (defun ruby-tools-symbol-region ()
(list (list
Expand Down

0 comments on commit 9d52cf7

Please sign in to comment.