From a3c8202d0eba75b84a54c2c2ebded0d46a507f3b Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 28 Jul 2016 16:18:36 +0100 Subject: [PATCH] support jumping to position with line and column from log entries --- .../public/coffee/ide/editor/EditorManager.coffee | 2 +- .../cursor-position/CursorPositionManager.coffee | 12 ++++++------ .../coffee/ide/pdf/controllers/PdfController.coffee | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/services/web/public/coffee/ide/editor/EditorManager.coffee b/services/web/public/coffee/ide/editor/EditorManager.coffee index 54d56cac19..64cbe1d884 100644 --- a/services/web/public/coffee/ide/editor/EditorManager.coffee +++ b/services/web/public/coffee/ide/editor/EditorManager.coffee @@ -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 () => diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee index 7019b213b5..6e238122e1 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee @@ -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() \ No newline at end of file + gotoLine: (line, column) -> + @editor.gotoLine(line, column) + @editor.focus() diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 968cd1b60f..5dff3acb04 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -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) ->