Split editor into two views #70

dotta opened this Issue Aug 20, 2012 · 0 comments


None yet
1 participant

dotta commented Aug 20, 2012

Using the document where the user writes his code to diplay the evaluation result is wrong, and it's the source of several UEX issues (e.g., caret position not set at the right place #25). IMO, the right way to fix this is to split the editor into two separate views:

  • A left one used by the user to write code, and
  • right one to show the evaluation result.

Simple and clean.

With the splitted view then we should also have automatic folding/unfolding of the evaluation result based on the expression selected in the left editor (with some highlighting, similar to what diff tools do). Isn't that nice? ;-)

dotta added a commit to dotta/scala-worksheet that referenced this issue Aug 20, 2012

Fix #25 - Caret is kept at the same position after evaluation
* Empty lines are no longer stripped, the reasons are:
    + Keep correct indentation of empty lines.
    + Correct handling of caret position (i.e., if the caret is
      in the middle of an empty line, it should stay there after
* The new caret position can never be after the old caret position
  (this should motivate the change in Mixer.scala)

This fixes the issue with correctly updating the caret position in
most of the situations, but not all of them. Honestly, I don't think
we should spend more time with trying to improve this, because messing
with the user's document is just wrong. Instead, we should split the
editor into two views: a left one used by the user to write code, and
a right to show the evaluation result (#70).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment