mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
support jumping to position with line and column from log entries
This commit is contained in:
parent
5da1b90418
commit
a3c8202d0e
3 changed files with 10 additions and 8 deletions
|
@ -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 () =>
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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) ->
|
||||
|
|
Loading…
Reference in a new issue