avoidMultipleOperations becomes false with a 10 seconds timeout after pressing the compile button.
The new code introduced by 99f6043ced didn't take this into account, so the port was being reopened before staring the actual upload.
Also, make uploading variable static to avoid preferences confusion (this should be solved in a saner way giving every Editor instance its own set of properties, but it will hopefully fixes by the cli integration and workspace concept)
- Use LinkedList with ListIterator to make all methods except for `clear()` run in `O(1)` (constant runtime) instead of `O(n)` (linear runtime).
- No longer store executed commands that are executed multiple times (executing {1, 1, 1, 1, 2} now only adds {1, 2} to the history).
The behavior is as follows:
- Pressing the UP key will select older commands.
- Pressing the DOWN key will select newer commands, restoring the last unexecuted command if available.
- Pressing the ESC key will reset the input field to the latest unexecuted command and reset the traversal location. Pressing ESC while the latest unexecuted command is selected will clear the input field.
This fixes#4891, with the difference that the proposed solution has a command history per Arduino session and this implementation has a command history per serial monitor start.
When creating a new sketch, it is initialized with the BareMinimum example sketch. This example sketch uses 2-width whitespace indentation, which might differ from the user-defined tab settings. This commit makes the generated example sketch consistent with the user-defined tab settings.
- use diamond notation <> to remove redundant type specification
- do no cache listeners, because it makes the code heavier for a
a very small gain in memory usage.
- removed redundant "this" keywords
platform.getId() gives the same result for derived cores.
Issue #5260 is caused by both cores declaring as `avr`, with the same label but different identifier.
This patch completes the previous one by adding the folder where the core resides to the matching id.
- Add contextual menus to text-based monitors (serial / network monitor).
- Add contextual menu to installer dialog search filter fields (library manager / contribution manager).
- Make installer dialogs focus the search filter field on window-open. This prevents pastes from ending up elsewhere in the case that they are performed before the field has been focussed at least once.
Fixes#8423.
Fix CommandLineTest.testCommandLineVersion() failing on Windows due to Runtime.exec() returning `\r\n` line endings where the test expected `\n` line endings.
Not wrapping these calls in FileUtils methods makes the code cleaner and easier to understand (FileUtils is very poorly documented, whereas direct calls contain proper documentation).
When having "autocrlf=input" (as described in the Building Arduino guide), the `.hex` files used in the test will be a different size due to the test expecting `\n` and git cloning as `\r\n`. This commit fixes this issue by removing cariage returns before running the test.
Add CTRL +/- and CTRL scroll shortcuts to increase/decrease editor console output text size. This font size is shared with the editor and serial/network monitor. Adjusting the font size on any of these will update them all.
Partially fixes#8615.
Make the editor console font properly update with editor font size changes. Before this commit, only newly added text would have an adjusted size, making it possible to have multiple text sizes in the editor console.
No functional changes:
- Fix compiler/IDE warnings in monitor classes.
- Replace listeners to use lambda classes where convenient in monitor classes.
- Code cleanup.
Add CTRL +/- and CTRL scroll shortcuts to increase/decrease serial/network monitor output text size. This font size is shared with the editor and adjusting either will update both.
Partially fixes#8615
Add "CTRL =" as additional shortcut to increase the editor font size. This shortcut should be added because the '+' and '=' characters are often on the same key on the keyboard and having to press SHIFT as well is not intuitive for all users (especially since many common applications support "CTRL =").
Fixes#8457
For some reason, getCurrentTab().getTextArea().getFoldManager().ensureOffsetNotInClosedFold(line) doesn't work here; there no documentation on what offset is.
Also, getFoldForLine(line) returns null even if the line is folded (bug in rsyntaxtextarea?)
Fixes#8413
handleQuit() already checks for confirmation if the sketch has been modified (when invoked directly).
When invoked indirectly (via handleClose(), as we are closing the last open Editor instance), checkModified() is redundant.
Don't call System.exit() but trust the ThinkDifferent handler
Handle reopen only if no editor is visible
Don't dispose last closing editor (so its toolbars are still in active state)
Fixes#7924
JRE 8u161 made JMenu.insert() MUCH slower on OSX.
This exposed a bug lurking there for years; in fact the menu entries were rebuilt every time since JMenu.getComponent() returns an empty list.
The correct function is JMenu.getMenuComponents().
In the meantime, also remove sketchbookMenu and examplesMenu being deleted on board change; only their content needs to be updated, not the container itself.
This patch dramatically reduce pressure on heap memory:
- use a StringTokenizer instead of the very slow String.split(...)
method to decode newlines. This avoid allocation/deallocation of
big strings array and use of regexp.
- pre allocate as many object as possible to avoid new allocation
while streaming data.
- the "timestamp" string is calculated only once per iteration.
- use StringBuilder instead of inline temporary strings (that are,
again, allocated and deallocated on each iteration)
This commits adds the "CTRL SHIFT =" as key to increase font size.
The old shortcut "CTRL +" is still active, but it's not always
possible to produce it if the keyboard layout doesn't have the + key
on the base layer.
This add the possibility to compose "CTRL +" when the keyboard has
the "+" available as "SHIFT =", that seems to be very common in
many layouts.
Fix#6806
- Specify that library name error is about folder name.
- We would normally expect "library name" to mean the "fancy name" (as defined by the library.properties name field).
- Specify exactly which characters are allowed.
- State that spaces are prohibited in sketch folder name.
- Remove outdated message about library folders not being allowed to start with a number.
- This restriction was removed by 4545283ae7.
- State library folder name length restriction.
- Make sketch and library messages consistent with each other.
* CLI: Add --version to CLI option
I added to get the Arduino IDE version from the command line
It will allow to check easily if the new Arduino is already installed.
This feature makes it easier to build external systems linked to specific versions of Arduino.
1. I added `--version` action, which shows version name and exit
1. Currently, VERSION_NAME_LONG (like `1.8.5`, `1.9.0-beta`, `1.8.6 Hourly Build XXX`, etc...) is used. Because I want to know its version number and stable/beta/hourly.
2. Finish with `0`. Because it is `SUCCESSFLLY FINISHED`.
2. Updated man page.
* Split "parse" and "action".
Move print action to probably suitable place.
This commit will fix the behavior of multiple actions about --version.
* add testcase
Those fields have a slightly different meaning on each object that
extends DownloadableContribution and having them grouped in
DownloadableContribution only increase confusion in change of a
(very) tiny code reuse.
Moreover:
- the `readOnly` field has been renamed to `builtIn`
- predicates have been replaced by lambdas
- DownloadableContributionBuiltInAtTheBottomComparator has been replaced
with a singleton instance
- replaced the logic to check if an installed-library is a
builtin library by reusing the same method available in
ContributedLibraryReleases
- renamed some local vars to better reflect their contents:
uninstalledLibraries -> notInstalled
uninstalledNewerReleases -> notInstalledNewer
uninstalledPreviousReleases -> notInstalledPrevious
This class allows to attach a Location property to a folder
path, this way we directly know if a library is in the sketchbook,
core, referenced-core or bundled in the IDE.
This simplify a lot of logic in the IDE.
ContributedLibrary is used to decode library_index.json and it's
intended to keep data coming only from the index.
Now, when the library_index is synced with the filesystem, the
metadata about installed libraries are kept in a separate list
to not mess up with the main index.
Previously the filtering was made on ContributedLibrary, but the
objects that is actually displayed is a ContributeLibraryReleases,
so it comens natural to filter on this class of objects.
Apparently the functionality is not affected by this commit, but
there may be some side-effect that may probably fix some
visualization bug.
Optional<T> helps to not forget to check about nullness where it is
needed.
This commit should be equivalent and shouln't fix any bug, BTW the
Optional<T> semantic turns out to be useful in the next commits.
Possibly all nullable values will be replaced by Optional in the
future.
- we ensure that there is always a filter selected, no more need
to check for non-nullness
- the filters are always the same, no need to pass a
Stream<Predicate<T>> around where Predicate<T> suffices