Skip to content

Instantly share code, notes, and snippets.

@eugenesvk
Created October 17, 2022 11:54
Show Gist options
  • Save eugenesvk/f0904325384de088816af8b0c88571f3 to your computer and use it in GitHub Desktop.
Save eugenesvk/f0904325384de088816af8b0c88571f3 to your computer and use it in GitHub Desktop.
Sublime Text's status bar with →5↓6 instead of Line 6, Column 5
import sublime, sublime_plugin
import Default # use save_selections function to do ⇥ to ␠ calculations
class ShowLnColInStatusCommand(sublime_plugin.EventListener):
def on_selection_modified_async(self, view):
statusName = '02_LnCol'
selection = view.sel()
if len(selection) == 0:
view.erase_status(statusName)
return
LnCol = Default.indentation.save_selections(view,selection)
Ln = LnCol[0][0][0]+1
Col = LnCol[0][0][1]+1
if (Ln is None) or (Col is None):
view.erase_status(statusName)
return
view.set_status(statusName, '→'+str(Col) +'↓'+str(Ln))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment