support jumping to position with line and column from log entries

This commit is contained in:
Brian Gough 2016-07-28 16:18:36 +01:00
parent 5da1b90418
commit a3c8202d0e
3 changed files with 10 additions and 8 deletions

View file

@ -46,7 +46,7 @@ define [
done = () =>
if options.gotoLine?
@$scope.$broadcast "editor:gotoLine", options.gotoLine
@$scope.$broadcast "editor:gotoLine", options.gotoLine, options.gotoColumn
if doc.id == @$scope.editor.open_doc_id and !options.forceReopen
@$scope.$apply () =>

View file

@ -23,10 +23,10 @@ define [], () ->
@storeCursorPosition(@editor.getSession())
@storeScrollTopPosition(@editor.getSession())
@$scope.$on "#{@$scope.name}:gotoLine", (editor, value) =>
if value?
@$scope.$on "#{@$scope.name}:gotoLine", (editor, line, column) =>
if line?
setTimeout () =>
@gotoLine(value)
@gotoLine(line, column)
, 10 # Hack: Must happen after @gotoStoredPosition
storeScrollTopPosition: (session) ->
@ -53,6 +53,6 @@ define [], () ->
@editor.getSession().setScrollTop(pos.scrollTop or 0)
delete @ignoreCursorPositionChanges
gotoLine: (line) ->
@editor.gotoLine(line)
@editor.focus()
gotoLine: (line, column) ->
@editor.gotoLine(line, column)
@editor.focus()

View file

@ -556,7 +556,9 @@ define [
return if !entity? or entity.type != "doc"
if entry.line?
line = entry.line
ide.editorManager.openDoc(entity, gotoLine: line)
if entry.column?
column = entry.column
ide.editorManager.openDoc(entity, gotoLine: line, gotoColumn: column)
]
App.controller 'ClearCacheModalController', ["$scope", "$modalInstance", ($scope, $modalInstance) ->