SublimeText / ColdFusion

ColdFusion Sublime Text Package
MIT License
197 stars 64 forks source link

CFM & CFC not considered "source code" for purposes of "auto" word_wrap detection #101

Open atuttle opened 11 years ago

atuttle commented 11 years ago

The comments for the default setting of word_wrap is:

// Disables horizontal scrolling if enabled.
// May be set to true, false, or "auto", where it will be disabled for
// source code, and otherwise enabled.

However, by default, CFM and CFC files (confirmed: using the ColdFusion syntax) do wrap. It would seem, then, that for whatever mechanism this feature is looking at, ColdFusion syntax is not considered source code.

atomi commented 11 years ago

Since CFM files generally contain HTML they are scoped text.html.cfm.- which is how all other packages handle mixed HTML+Source. CFC files are scoped source.cfscript.cfc but if you are within <cfcomponent> tags the scope will be source.cfscript.cfc - text.html.cfm.embedded.cfml - which enables cfml tag completions instead of cfscript function completions.

You probably already know you can easily toggle word_wrap by pressing ctrl+shift+p and searching word_wrap or assigning a key-binding to the toggle word_wrap command.

It's possible to also code a plugin that is specific to ColdFusion files that would toggle word_wrap for you under various conditions.

I'm just not likely to change the scope of CFM or CFC files for word_wrap.

But, if you can be a little more clear on what your needs are we might be able to work something out on the plugin side of this. For instance an additional option for word_wrap that is specific to CFM and CFC files under ColdFusion.sublime-settings could be possible.

My immediate understanding is that you want word_wrap disabled for both CFM and CFC files when "word_wrap" is set to "auto" in preferences. But let me know what your thoughts are here and we can move forward.

atuttle commented 11 years ago

The goal is for word wrap to behave like other source code languages. I did a really quick check, and it looks like PHP doesn't have this problem (and that's source mixed in with html, right?) ... I just created a .php file and started mashing the keyboard: It didn't wrap. That's what I think is logical, and that's what I'm reporting. The logical thing is for word wrap to be off when the user setting is "auto".

Of course I can change my own settings, but I'm attempting to help make the world a better place by setting saner defaults for everyone else. :)

atomi commented 11 years ago

The problem is Sublime itself isn't consistent in this case. For example both .asp (text.html.asp) and .yaws (text.html.eralng.yaws) files are not considered source files for purposes of word_wrap.