bolerio / seco

Advanced Scripting IDE for JVM based languages.
28 stars 4 forks source link

Forced cell wrapping #27

Open bolerio opened 9 years ago

bolerio commented 9 years ago

The default text wrapping of the Swing text framework does a good job of breaking at whitespaces to fit the text into the available view width. However, some outputs, particularly exceptions with complicated stack traces and error messages printing out some data without whitespaces end up not being broken and the width of the view becomes ginormous because of a single rogue output cell, one has to scroll a lot to get to the visual cell handles and it's awkward.

We need a solution to this: a configurable, default true, option to force wrap all cells, scripts can usually be broken following the language lexical structure while output cells should be broken arbitrarily with some special indicator character at the end of line like emacs does.

bolerio commented 9 years ago

FYI, the logic to break a long line to fit a desired view width can be found in the JRE GlyphView.breakView method. Both InputCell and OutputCell in Seco end up with the same InlineView for textual output. When it's an input cell, it's got an extra ScriptSupport magic, but fundamentally the logic is the same.