brianc / jade-mode

Emacs major mode for jade template highlighting
MIT License
156 stars 41 forks source link

Apostrophe not parsed correctly #20

Closed falcondai closed 9 years ago

falcondai commented 11 years ago

example:

p= 'i should be parsed as string delimiter'
p i shouldn't be parsed as the beginning of a string 

i am seeing the second line being parsed incorrectly

brianc commented 11 years ago

hmmm I don't actually use emacs anymore. :grin: If you're feeling freaky, you can drop down into elisp and see if you can fix it? I accept almost every pull request on this repo and still maintain it.

falcondai commented 11 years ago

i would love to do that! in fact, i just started learning emacs, so elisp would be a good lesson. what text editor did switch to? sublime?

brianc commented 11 years ago

VIM. :)

On Thu, Aug 8, 2013 at 9:18 AM, Falcon Dai notifications@github.com wrote:

i would love to do that! in fact, i just started learning emacs, so that would be a lesson. so what text editor did switch to? sublime?

— Reply to this email directly or view it on GitHubhttps://github.com/brianc/jade-mode/issues/20#issuecomment-22326428 .

lefnire commented 11 years ago

How could you

brianc commented 11 years ago

haha I know! I just found vim to be a more productive environment. I think emacs has its place for sure...used it for 2 years, but eventually the call of VIM was too strong & I went back. And I have to tell you...I honestly haven't looked back. xoxoxo

brianc commented 11 years ago

except for org-mode. that shit is bananas.

b

a

n

a

n

a

s

ProCynic commented 10 years ago

yeah, I'm getting this too

tjefferson08 commented 9 years ago

+1

tjefferson08 commented 9 years ago

Looks like it's due to the rendering order of font-lock (?). My guess is the syntax table has the single quote (') in it (from a parent mode like sws-mode or fundamental-mode). Even if you add a keyword search which isolates the block of text with the ' in it, the fact that quotes are actual syntax table entries gives them higher priority (I can't actually find this rendering order documented anywhere, but experimentation manifests this phenomenon). I'm working on a fix which will remove the quote chars from the syntax table and instead use search-based fontification to highlight strings (only where it's jade-appropriate). For reference: here's the documentation for syntactic fontification