Permalink
Browse files

fixing search by existing comments

  • Loading branch information...
1 parent 3de60d4 commit ea62967e3911ee3f597987df6413da3c6c93b8cb @americodls committed Sep 11, 2012
Showing with 3 additions and 6 deletions.
  1. 0 Changelog → CHANGELOG
  2. +3 −6 lib/magic_encoding.rb
File renamed without changes.
@@ -34,12 +34,9 @@ def self.process(options)
lines = file.readlines
# remove current encoding comment(s)
- while lines[0] && (
- lines[0].starts_with?(comment_style.sub('{text}', 'encoding')) ||
- lines[0].starts_with?(comment_style.sub('{text}', 'coding')) ||
- lines[0].starts_with?(comment_style.sub('{text}', '-*- encoding')))
- lines.shift
- end
+ while lines[0].match(/^-?# ?(-\*-)? ?(en)?coding/)
+ lines.shift
+ end
# set current encoding
lines.insert(0,comment_style.sub('{text}', prefix))

0 comments on commit ea62967

Please sign in to comment.