Support clicking past last editor line

Clicking below the last line of an editor
now either moves the cursor to the end of
the file or selects to the end of the file
if shift is pressed.
This commit is contained in:
Kevin Sawicki
2012-12-26 11:04:10 -08:00
parent 14e5dde418
commit 518a71910d
2 changed files with 27 additions and 0 deletions

View File

@@ -326,6 +326,14 @@ class Editor extends View
@removeClass 'focused'
@autosave() if config.get "editor.autosave"
@scrollView.on 'click', (e) =>
return unless e.target is @scrollView[0]
return unless e.offsetY > @overlayer.height()
if e.shiftKey
@selectToBottom()
else
@moveCursorToBottom()
@overlayer.on 'mousedown', (e) =>
@overlayer.hide()
clickedElement = document.elementFromPoint(e.pageX, e.pageY)