def run(self, edit):

        sel = self.view.sel()[0]

        # insert the actual &gt; character
        for region in self.view.sel():
            self.view.insert(edit, region.end(), ">")

        # prevents auto_complete pop up from triggering
        self.view.run_command("hide_auto_complete")

        # return if disabled in settings file
        if not SETTINGS.get("auto_close_cfml"):
            return

        # prevents triggering inside strings and other scopes that are not block tags
        # this should be taken care of in keybindings, but it's not working for cfcomponent
        if self.view.match_selector(sel.end(), "string") \
            or self.view.match_selector(sel.end(), "source.cfscript.embedded.cfml") \
            or not self.view.match_selector(sel.end(), "meta.tag.block.cf"):
            return

        for region in self.view.sel():
            pos = region.begin()

            tagdata = self.view.substr(sublime.Region(0, pos)).split("<")
            tagdata.reverse()
            tagdata = tagdata.pop(0).split(" ")
            tagname = tagdata[0]

        if self.view.match_selector(sel.end(),"meta.tag.block.cf")  \
            and not self.view.substr(sel.end() - 1) == "/" \
            and not tagname[0] == "/":

            if not tagname[-1] == ">":
                tagname = tagname + ">"
            if not SETTINGS.get("auto_indent_on_close") or tagname == "cfoutput>":
                self.view.run_command("insert_snippet", {"contents": "$0</" + tagname})
            else:
                self.view.run_command("insert_snippet", {"contents": "\n\t$0\n</" + tagname})
dataset/ETHPy150Open SublimeText/ColdFusion/coldfusiontagcompletions.py/CloseCftagCommand.run/original