yoya / js2-mode

Automatically exported from code.google.com/p/js2-mode
0 stars 0 forks source link

mixed EOL confuse js2-mode #105

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. using js2-mode on any mixed EOL file (for example http://
jqueryjs.googlecode.com/files/jquery-1.3.1.js has unix EOL at the 
beginning, but in the middle of the file dos EOL is used)

What is the expected output? What do you see instead?
^M characters are treated as illegal characters and the entire code 
following first unfortunate ^M is subject to bogus warnings and errors.

Please use labels and text to provide additional information.
I'm not sure that threating CR as whitespace is an OK solution, but
I've included #xD to whitespace characters and it seemed to do the trick.  
(defsubst js2-js-space-p (c)
  (if (<= c 127)
      (memq c '(#x20 #x9 #xC #xB #xD))
    (or
     (eq c #xA0)
     ;; TODO:  change this nil to check for Unicode space character
     nil)))

Original issue reported on code.google.com by ed.sinji...@gmail.com on 18 Jul 2009 at 8:17

GoogleCodeExporter commented 8 years ago
Thanks for the patch!  I'll include this in the next release.

Original comment by steve.ye...@gmail.com on 23 Jul 2009 at 11:15

GoogleCodeExporter commented 8 years ago
Fixed in 20090723b.el

Original comment by steve.ye...@gmail.com on 23 Jul 2009 at 11:38