-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for issue #30 #35
Conversation
I would think it would be better to have the html grammar added back to cfml.cson, as cfml tags are intended to be interspersed with html. The only thing I don't like about having to scan for mixed mode is if you run into a situation where you are scanning hundreds of lines on every change to the file (the event is slightly buffered, but every keystroke runs the did-change event). |
@dajester2013 We could only scan the file on open? I wouldn't remove the cfml only mode, but we could remove the fileTypes array? the cfml only mode allows for a separation of concerns and I find it particularly useful when testing. |
Scanning the file on change allows someone to open a blank cfc file with the CFML grammar active, then start typing I was reserved on adding the file change listener to begin with, that's why I only looked for the first non-empty line. |
…mprove recognition of mixed mode.
I just peaked at the docs for the did-change, it passes a delta containing the line/s that have been changed. Think we could write it to only update based on the actual changed lines? I.e if they type |
I don't know if that would work. The grammar should only be determined based on the first line. I originally used a regex scan, but I had a problem where if I typed something like:
it would start switching back and forth between the cfml and cfscript grammars rapidly. I think that would be the case if it were only inspecting the deltas. |
Well removing the |
Sorry, I'm quite busy today and having some trouble keeping up with all of the conversations. Is this PR ok to merge, then? |
I'm good with it.
|
|
Added editor listeners to set .cfm files to html/cfml mixed mode if the file contains non cfml tags.