You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pr...@apache.org on 2017/05/03 15:43:37 UTC

zeppelin git commit: ZEPPELIN-2459 Zeppelin Usability Improvement for new paragraph

Repository: zeppelin
Updated Branches:
  refs/heads/master e4f399f1b -> 82c92d110


ZEPPELIN-2459 Zeppelin Usability Improvement for new paragraph

### What is this PR for?
Move cursor to second line for new paragraphs

### What type of PR is it?
Improvement

### Todos
* [ ] - Task

### What is the Jira issue?
ZEPPELIN-2459

### How should this be tested?
For a new paragraph he initial cursor position should be on the second line.

### Screenshots (if appropriate)
**Before**
<img width="324" alt="screen shot 2017-04-26 at 10 27 48 pm" src="https://cloud.githubusercontent.com/assets/2031306/25446579/9dcdeb2a-2acf-11e7-883d-e0ccf2ef834d.png">

**After**
<img width="394" alt="screen shot 2017-04-26 at 10 27 33 pm" src="https://cloud.githubusercontent.com/assets/2031306/25446593/a66289da-2acf-11e7-8d8e-2029339f0133.png">

### Questions:
* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? n/a

Author: Renjith Kamath <re...@gmail.com>

Closes #2291 from r-kamath/ZEPPELIN-2459 and squashes the following commits:

4c6525d1c [Renjith Kamath] ZEPPELIN-2459 Zeppelin Usability Improvement for new paragraph


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/82c92d11
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/82c92d11
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/82c92d11

Branch: refs/heads/master
Commit: 82c92d110ccbdd986c58e5600a62f7cd44aedfb1
Parents: e4f399f
Author: Renjith Kamath <re...@gmail.com>
Authored: Wed Apr 26 22:24:01 2017 +0530
Committer: Prabhjyot Singh <pr...@gmail.com>
Committed: Wed May 3 21:13:30 2017 +0530

----------------------------------------------------------------------
 .../src/app/notebook/paragraph/paragraph.controller.js      | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/82c92d11/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 3cb8902..044d9b8 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -629,9 +629,18 @@ function ParagraphCtrl ($scope, $rootScope, $route, $window, $routeParams, $loca
       $scope.editor.getSession().setUseWrapMode(true)
       $scope.editor.setTheme('ace/theme/chrome')
       $scope.editor.setReadOnly($scope.isRunning($scope.paragraph))
+
       if ($scope.paragraphFocused) {
+        let prefix = '%' + getInterpreterName($scope.paragraph.text)
+        let paragraphText = $scope.paragraph.text ? $scope.paragraph.text.trim() : ''
+
         $scope.editor.focus()
         $scope.goToEnd($scope.editor)
+        if (prefix === paragraphText) {
+          $timeout(function () {
+            $scope.editor.gotoLine(2, 0)
+          }, 0)
+        }
       }
 
       autoAdjustEditorHeight(_editor)