Home Download Buy Blog Forum Support

Display total line count

Re: Display total line count

Postby jps on Mon Jan 25, 2010 10:25 pm

You can used view.setStatus() to assign a persistent status message with a view - see the API reference for details. You'll want something along the lines of (untested, btw):

Code: Select all
import sublime, sublimeplugin

class CustomStatusBar(sublimeplugin.Plugin):
    def onModified(self, view):
        totalLines = len(view.lines(sublime.Region(0L, view.size())))
        msg = '%d lines' % (totalLines)
        sublime.setStatus('totalLines', msg)

    def onLoaded(self, view):
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Re: Display total line count

Postby thei on Thu Apr 11, 2013 1:55 am

ToddFiske wrote:Other editors I've used would even show the decimal and hex value of the current character, which would be cool to have.

Does anyone know any way to do this? Even if it isn't in the status bar, though that would be ideal. It is something all the other editors I have used/tried tend to do, and something I find very useful.
Posts: 3
Joined: Tue Apr 09, 2013 4:58 am


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests