How do I get the current source type? I can get the whole line, punctuation, numbers etc, but how about just "source.json" or "source.php" say?
- Code: Select all
import sublime, sublime_plugin
def run(self, edit):
for region in self.view.sel():
syntax = self.view.syntax_name(region.begin())
I guess I could regex it out, but I'm intrigued to know if there is a better way?