Log Message: |
Part of PIVOT-696: Add support for viewing tab characters in TextArea.
Already the TerraTextAreaSkin has a "tabWidth" style, and supports
Ctrl-Tab entering a "tab" which is a number of spaces up to the tab
width.
This change extends that to the "setText" method. The TextArea.Skin
interface adds a "getTabWidth" method so the component can know what
the current setting is. Then in "setText", keep track of the current
position in the line (since the last \n) and when a \t is encountered
in the stream, convert it to a number of spaces according to the
position and the tabWidth setting.
The combined effect is that files with tab characters will look the
same as with editors that really support tabs (albeit with the tabs
replaced by the appropriate number of spaces).
|