Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Sublime Text 2/3 script to show character position

Copied from here

Save as .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)
@ariley

This comment has been minimized.

Show comment Hide comment
@ariley

ariley Nov 17, 2017

Thank you!

ariley commented Nov 17, 2017

Thank you!

@ben-harack

This comment has been minimized.

Show comment Hide comment
@ben-harack

ben-harack Jan 25, 2018

Awesome.

Awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment