Selecting lines by selecting line number


#1

Another great feature would be to allow developers to select a whole line by selecting the line number on the left pane.


#2

I created the script that you need.

You need to add this code to your init.coffee file.

{$} = require 'atom'
atom.workspaceView.eachEditorView (editorView) ->
  editor = editorView.getEditor()

  $('.line-number').on 'click', ->
    line = parseInt $(this).text()
    editor.selectLine(line)

On click events
#3

Thanks AbeEstrada!! I will add this to the init.coffee file right away


#4

This is awesome. Could it be a package?


#5

Actually, if you look here:

It turns out that they implemented selecting the line by Shift-clicking the line number.


#6

Thanks mucho. I wonder why the shift is required. Many IDEs including Visual Studio just require a click.

Oh, I see it is just moving the cursor. I guess that gives you an automatic two-for-one feature.