Skip to content

Commit

Permalink
use \w not [[:word:]], the latter is not in ruby 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
eapache committed Jul 13, 2014
1 parent ce12790 commit 5c736ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/starscope/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def export_cscope(file)
key = record[:name][-1].to_s
index = line.index(key)
while index &&
((index > 0 && line[index-1] =~ /[[:word:]]/) ||
(index+key.length < line.length && line[index+key.length] =~ /[[:word:]]/))
((index > 0 && line[index-1] =~ /\w/) ||
(index+key.length < line.length && line[index+key.length] =~ /\w/))
index = line.index(key, index+1)
end
toks[index] = record unless index.nil?
Expand Down

0 comments on commit 5c736ff

Please sign in to comment.