ColdFusion icon indicating copy to clipboard operation
ColdFusion copied to clipboard

ST3: Auto-closing tag doesn't indent properly

Open abramadams opened this issue 12 years ago • 9 comments

When I type the > on a cf tag, i.e. <cfif ...> it auto inserts the closing tag two lines down (which is good), but the closing tag is completely flushed left instead of at the same indentation as the opening tag. You end up with something like:

      <cfif something is true>
         |
</cfif>

abramadams avatar Sep 27 '13 21:09 abramadams

I'm seeing the same behavior.

danshort avatar Oct 07 '13 15:10 danshort

I'm also seeing this behavior:

SublimeText/ColdFusion dev branch commit 4d6122754d86dcccb29389098de0a65b0b9c5645 ST3, Stable, Build 3047 OSX 10.9 3.2 GHz Intel Core i5 8 GB RAM

screen shot 2013-12-04 at 3 05 04 pm

Let me know if you need any more info. or reproduction info.

sekanitembo avatar Dec 04 '13 23:12 sekanitembo

Sorry for the dumb question, but how do we apply this fix to the code? It doesn't appear to be included in the development branch. Can I just modify the coldfusion-plugin.py file and save or does it need to be compiled or what?

nwinters71 avatar Jul 09 '14 18:07 nwinters71

It hasn't been merged into the project yet. Right now it's just a pull request.

atuttle avatar Jul 09 '14 19:07 atuttle

Thanks for the response. When you say that it's just a pull request, does that mean that I can't use it yet or if I can, what exactly do I need to do. I've updated the coldfusion-plugin.py (which I'm guessing is a python file) with the changes, but it's not having any effect. I have no idea if it needs to be compiled or what.

nwinters71 avatar Jul 09 '14 19:07 nwinters71

I don't actually know (if it needs to be compiled -- though I suspect not). It sounds like @rossmd is working on a fix though, so probably best to just be patient. :)

atuttle avatar Jul 09 '14 20:07 atuttle

Thanks. I'll try to be patient.

nwinters71 avatar Jul 09 '14 20:07 nwinters71

fwiw, you just need to edit the coldfusion-plugin.py file and save it. You can change line 143 to:

 self.view.insert(edit,temp.b,"\n\t\n</" + tag_name + ">")

Also found changing line 141 to:

indent = not s.get("auto_indent_on_close")

fixes a bug with <cfouptut>

abramadams avatar Jul 09 '14 21:07 abramadams

That worked. Thanks for the info regarding cfoutput, that fixed an even more bothersome issue for me. The end tag was being added, but the cursor would go the line above. At least now cfoutput is working the same way as the other tags that have closing tags. Not perfect, but much better. Thanks!

nwinters71 avatar Jul 09 '14 21:07 nwinters71