rodrigosantosbr

Sublime Text script to show character position

Jan 28th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

Sublime Text script to show character position

Save as characterCounter.py , put in (Preferences > Browse Packages > User) and restart Sublime

import sublime_plugin

class PositionListener(sublime_plugin.EventListener):

    def on_selection_modified(self, view):
        text = "Position: "
        sels = view.sel()
        for s in sels:
            text += " " + str(s.begin())
            if not s.empty():
                text += "-" + str(s.end()) + " "
        view.set_status('exact_pos', text)
Add Comment
Please, Sign In to add comment