mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Store tag location in a Point
This commit is contained in:
@@ -13,9 +13,9 @@ describe "OutlineView", ->
|
||||
generator.generate().done ->
|
||||
expect(tags.length).toBe 2
|
||||
expect(tags[0].name).toBe "quicksort"
|
||||
expect(tags[0].row).toBe 0
|
||||
expect(tags[0].position.row).toBe 0
|
||||
expect(tags[1].name).toBe "quicksort.sort"
|
||||
expect(tags[1].row).toBe 1
|
||||
expect(tags[1].position.row).toBe 1
|
||||
|
||||
it "generates no tags for text file", ->
|
||||
waitsForPromise ->
|
||||
|
||||
@@ -20,12 +20,12 @@ class OutlineView extends SelectList
|
||||
initialize: (@rootView) ->
|
||||
super
|
||||
|
||||
itemForElement: ({row, name}) ->
|
||||
itemForElement: ({position, name}) ->
|
||||
$$ ->
|
||||
@li =>
|
||||
@div name, class: 'function-name'
|
||||
@div class: 'right', =>
|
||||
@div "Line #{row + 1}", class: 'function-line'
|
||||
@div "Line #{position.row + 1}", class: 'function-line'
|
||||
@div class: 'clear-float'
|
||||
|
||||
toggle: ->
|
||||
@@ -44,9 +44,9 @@ class OutlineView extends SelectList
|
||||
@setArray(tags)
|
||||
@attach()
|
||||
|
||||
confirmed : ({row, column, name}) ->
|
||||
confirmed : ({position, name}) ->
|
||||
@cancel()
|
||||
@rootView.getActiveEditor().setCursorBufferPosition([row, column])
|
||||
@rootView.getActiveEditor().setCursorBufferPosition(position)
|
||||
|
||||
cancelled: ->
|
||||
@miniEditor.setText('')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
Point = require 'point'
|
||||
ChildProcess = require 'child-process'
|
||||
|
||||
module.exports =
|
||||
@@ -29,8 +30,7 @@ class TagGenerator
|
||||
label = "#{label}#{signature}"
|
||||
|
||||
tag =
|
||||
row: line
|
||||
column: 0
|
||||
position: new Point(line, 0)
|
||||
name: label
|
||||
|
||||
return tag
|
||||
|
||||
Reference in New Issue
Block a user