mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Fix issue in jumping to next bookmark
This commit is contained in:
@@ -79,7 +79,7 @@ class BookmarksView
|
||||
bookmarkIndex = _.sortedIndex markers, bufferRow, (marker) ->
|
||||
if marker.getBufferRange then marker.getBufferRange().start.row else marker
|
||||
|
||||
bookmarkIndex++ if markers[bookmarkIndex].getBufferRange().start.row == bufferRow
|
||||
bookmarkIndex++ if markers[bookmarkIndex] and markers[bookmarkIndex].getBufferRange().start.row == bufferRow
|
||||
bookmarkIndex = 0 if bookmarkIndex >= markers.length
|
||||
|
||||
markers[bookmarkIndex]
|
||||
|
||||
@@ -115,6 +115,11 @@ describe "Bookmarks package", ->
|
||||
editor.trigger 'bookmarks:jump-to-next-bookmark'
|
||||
expect(editSession.getCursor().getBufferPosition()).toEqual [2, 0]
|
||||
|
||||
editSession.setCursorBufferPosition([11, 0])
|
||||
|
||||
editor.trigger 'bookmarks:jump-to-next-bookmark'
|
||||
expect(editSession.getCursor().getBufferPosition()).toEqual [2, 0]
|
||||
|
||||
it "jump-to-previous-bookmark finds previous bookmark", ->
|
||||
editSession.setCursorBufferPosition([0, 0])
|
||||
|
||||
@@ -126,3 +131,8 @@ describe "Bookmarks package", ->
|
||||
|
||||
editor.trigger 'bookmarks:jump-to-previous-bookmark'
|
||||
expect(editSession.getCursor().getBufferPosition()).toEqual [10, 0]
|
||||
|
||||
editSession.setCursorBufferPosition([11, 0])
|
||||
|
||||
editor.trigger 'bookmarks:jump-to-previous-bookmark'
|
||||
expect(editSession.getCursor().getBufferPosition()).toEqual [10, 0]
|
||||
|
||||
Reference in New Issue
Block a user