1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00
Arduino/app/test
Matthijs Kooijman 982d4f3fbf Use a separate RSyntaxTextArea for each editor tab
RSyntaxTextArea appears to support using a single instance and replacing
the underlying text and document when switching between tabs, but in
practice this support is not complete and even though the
RSyntaxTextArea developers did some work to improve the situation, they
recommend to just use a seperate instance for each tab.

This commit implements exactly that. A new class EditorTab is introduce
to wrap the RSyntaxTextArea and containing scroll pane, and to
encapsulate the code related to handling the text area itself. Doing so
removes some quirks and prepares for some later additions. In
particular, error highlights are now no longer shared between all tabs,
which was previously the case.

This commit mostly moves code from Editor into EditorTab, and updates
the callers to use getCurrentTab() and call methods on the result
instead of calling them on Editor. Some code is added to take care of
creating multiple EditorTab objects and switching between them. Some
small changes have been made to make the flow of opening files work,
though these are mostly a bit hacky.

While moving code, changes to the rest of the code were kept minimal,
retaining existing interfaces as much as possible. This sometimes result
in less than ideal code, which should be cleaned up in subsequent
commits.

The SketchCodeDocument class has been pretty much emptied out, since
it was mostly used to store things for tabs in the background, which are
now just stored in each RSyntaxTextArea separately. The last remaining
bits of this class can probably be moved or implemented differently
later, so it can be removed.

The entire flow of working with sketches and files needs to be cleaned
up next, so no thorough attempt at testing this commit was done. It is
likely that there are plenty of corner cases and race conditions, which
will be fixed once the reset of the code is cleaned up.

Fixes #3441
2016-08-26 16:42:44 +02:00
..
cc/arduino Correctly handle "-snapshot" and "+build" in semantic versioning 2016-08-16 11:00:35 +02:00
processing/app Use a separate RSyntaxTextArea for each editor tab 2016-08-26 16:42:44 +02:00
Keypad_mac.zip keep included folder name as top level folder name, delete MAC folder and hidden files 2012-10-18 16:00:02 +02:00
Keypad_with_hidden_files.zip keep included folder name as top level folder name, delete MAC folder and hidden files 2012-10-18 16:00:02 +02:00
optiboot_atmega328.hex Extending remote upload. Sketch merge with bootloader is done by the IDE (using "noblink" bootloader if board definition provides one). If platform provides a "remote" upload tool, that tool is used, otherwise falls back to hardcoded "run-avrdude" 2015-06-18 15:43:10 +02:00
sketch.hex Extending remote upload. Sketch merge with bootloader is done by the IDE (using "noblink" bootloader if board definition provides one). If platform provides a "remote" upload tool, that tool is used, otherwise falls back to hardcoded "run-avrdude" 2015-06-18 15:43:10 +02:00
Test2.zip Add library from ZIP 2012-10-17 15:25:29 +02:00
Test.zip Add library from ZIP 2012-10-17 15:25:29 +02:00