Coder Social home page Coder Social logo

status-bar's Introduction

Status Bar package

OS X Build Status Windows Build Status Dependency Status

Display information about the current editor such as cursor position, file path, grammar, current branch, ahead/behind commit counts, and line diff count.

Configuration

The status bar package accepts the following configuration values:

  • status-bar.cursorPositionFormat โ€” A string that describes the format to use for the cursor position status bar tile. It defaults to %L:%C. In the format string, %L represents the 1-based line number and %C represents the 1-based column number.

  • status-bar.selectionCountFormat โ€” A string that describes the format to use for the selection count status bar tile. It defaults to (%L, %C). In the format string, %L represents the 1-based line count and %C represents the 1-based character count.

API

This package provides a service that you can use in other Atom packages. To use it, include status-bar in the consumedServices section of your package.json:

{
  "name": "my-package",
  "consumedServices": {
    "status-bar": {
      "versions": {
        "^1.0.0": "consumeStatusBar"
      }
    }
  }
}

Then, in your package's main module, call methods on the service:

module.exports =
  activate: -> # ...

  consumeStatusBar: (statusBar) ->
    @statusBarTile = statusBar.addLeftTile(item: myElement, priority: 100)

  deactivate: ->
    # ...
    @statusBarTile?.destroy()
    @statusBarTile = null

The status-bar API has four methods:

  • addLeftTile({ item, priority }) - Add a tile to the left side of the status bar. Lower priority tiles are placed further to the left.
  • addRightTile({ item, priority }) - Add a tile to the right side of the status bar. Lower priority tiles are placed further to the right.

The item parameter to these methods can be a DOM element, a jQuery object, or a model object for which a view provider has been registered in the the view registry.

  • getLeftTiles() - Retrieve all of the tiles on the left side of the status bar.
  • getRightTiles() - Retrieve all of the tiles on the right side of the status bar

All of these methods return Tile objects, which have the following methods:

  • getPriority() - Retrieve the priority that was assigned to the Tile when it was created.
  • getItem() - Retrieve the Tile's item.
  • destroy() - Remove the Tile from the status bar.

status-bar's People

Contributors

50wliu avatar abeestrada avatar alhadis avatar ardagnir avatar as-cii avatar awans avatar benogle avatar damieng avatar devoncarew avatar izuzak avatar jonmagic avatar jonrohan avatar joshaber avatar kevinnathan avatar kevinsawicki avatar lee-dohm avatar lgeiger avatar maxbrunsfeld avatar mcolyer avatar mertkahyaoglu avatar mnquintana avatar mostafaeweda avatar oggy avatar peterdavehello avatar probablycorey-and-nathan avatar probablykevin avatar simurai avatar timoxley avatar tyriar avatar vjeux avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.