Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Editor (based on RSyntaxTextArea ) - 1.6.4 #3019

Closed
wants to merge 30 commits into from

Conversation

ricardojlrufino
Copy link
Contributor

Arduino New Editor

These amendments replace the old editor for the RSyntaxTextArea, which is an updated library and evolves separately

It is considered a prerequisite to integrate Autocomplete (#849)

Improvements and adjustments

[x] Syntax highlight (using xml files)
[ ] load the list dynamically (is currently fixed in the code)
[x ] Code Folding
[x] Add 'Auto Format' to Editor context menu
[x] Removed menu: Find using selection (not required!)
[x] Open Reference and Links using CTRL + Click

[x] Preferences for syntax highlighting theme
[x] Muli-line ident using TAB
[x] Automatic closing doc/comment block
[x] [Linux] Installation Script that creates shortcuts on the menu and desktop (with SplashScreen)
[x] [Linux] Best ICON for Alt+TAB
[x] [Linux] fix CTRL+'/' not working (need test on MacOS !)
[x] FIX: Ugly Icon and Name on Linux (ALT+TAB Window)

New Shortcuts

  • HOME: toggles between first character on line and first non-whitespace character on line.
  • INSERT: toggles between insert and overwrite modes.
  • TAB / SHIFT + TAB: Increase / Decrease Indentation
  • Alt + UP/DOWN : Move the current line up and down, respectively.
  • Ctrl + / : tootle comments
  • Ctrl+TAB / Control+SHIF+TAB: Change TABS (BUG: Control+SHIF+TAB not work on linux)
  • Ctrl+D: Delete current line
  • Ctrl+DELETE: deletes all text between the caret and the end of the current line.
  • Ctrl+J: joins lines.
  • Ctrl+Z: is undo and Ctrl+Y is redo.
  • Ctrl+Up and Ctrl+Down: shift the visible area of the text area up and down one line, respectively.
  • F2 and Shift+F2: moves to the next and previous bookmarks,respectively.
  • Ctrl+arrow keys: Better keyboard navigation

Tests

[x] comment / uncomment using shortcuts, menu, popup menu
[x] Copy to HTML and Forum
[x] Auto Format
[x] Find using selection (shortcut CTRL+F)
[ ] Fix Encoding & Reload (what is this ?)
[x] Find in Reference
[x] Open URL (from comment's)
[x] Add new Tab
[x] Open / Save sketch with multiple files
[x] Highlight compilation errors (even in other tabs)
[x] Undo / Redo (even in other tabs)
[x] Undo / Redo in Context Menu (even in other tabs is consistent)
- Improved Ctrl-z system (before was 1 for 1 character, so boring)
[x] Keywords.txt (including libraries)
[x] Keep Selection / Cursor when switch between Tabs
[x] Auto-close / Identation brackets in if/method/etc..
[x] Auto ident on new Line.
[x] Menu shortcuts (tests)
[x] Syntax coloring: use the same colors (only a small modification)
[x] Preferences: Show Lines Numbers

screenshot

@ffissore
Copy link
Contributor

@ArduinoBot build this please

@duff2013
Copy link
Contributor

I like the update! But code folding doesn't seem to work in the osx build? Its not selectable?
screen shot 2015-04-23 at 11 28 18 am

@00alis
Copy link
Contributor

00alis commented Apr 23, 2015

A really tiny detail, on Retina displays the Sketch name on the Tab is pixelated, while all the other text everywhere else is correctly rendered. What could be the cause of it?

@ricardojlrufino
Copy link
Contributor Author

@duff2013 try now ;)

@ricardojlrufino
Copy link
Contributor Author

@00alis you can attach a screenshot ?!

@ricardojlrufino
Copy link
Contributor Author

@ArduinoBot build this please

@damellis
Copy link
Contributor

There are a lot of changes here that may or may not be considered improvements, depending on your expectations. (Note that the following is mostly Mac centric, although I'm guessing there may be similar issues on other platforms.)

For example, this changes the behavior of Command-Left to go to the first non-whitespace character of a line instead of the first character. This corresponds with Processing's behavior but differs from the Mac default (e.g. in Xcode). Similarly, selecting text and hitting tab in Xcode seems to behave like a normal character entry (the selected text is replaced with the typed tab character), whereas other applications (like Processing) indent selected lines when you press tab.

Similar comment for Command-F using the current selection as the find text. This is non-standard behavior on Mac, which has a separate keyboard shortcut (Command-E) to search for the currently-selected text.

The Alt-Up and Alt-Down behavior (moving the current line up or down) is something I've never experienced in another application and wouldn't expect to happen here. Similar with Command-J (outside of vi).

The syntax highlighting look different. I believe we just deliberately chose colors for various kinds of keywords; do we want to change them again? The default font also looks different. Again, who should be deciding on these aspects?

This patch also seems to break some things. I can no longer click on links to open them, for example. I also can't Alt-Backspace to delete the word preceding the cursor (a standard Mac behavior).

Are there improvement here that I'm missing? Otherwise, this seems to just change a lot of things without necessarily making anything better.

@duff2013
Copy link
Contributor

@damellis
I really have to disagree on some this, there are many new enhancments that I consider quite nice. The UI is really in need of some features that you totally disregard i.e. code folding, error highlighting, unreadable error color, move line (Alt up/down), etc.. I really think this is good step forward for a more advanced UI in my opinion though I'm sure there is major room for UI improvement still.

@ricardojlrufino
Copy link
Contributor Author

This improvement is mainly focused on replacing the old editor at RSyntaxTextArea.

This has been proposed numerous times, the RSyntaxTextArea is a component that possesses enough interesting features (that were not explored in this modification, still ...), and evolves independently of the Arduino way.

One of the main points is to integrate Autocomplete
3 years waiting, I took the attitude and did.... #849
However had little feedback and it seemed that it was not a priority (I disagree)

Documentation of libraries in the Editor : #2692

Many of the things that you said was OSX details, I did not know (I use Linux), so there would have to meet these requirements. Could you help!

@PaulStoffregen
Copy link
Contributor

@ArduinoBot build this please

@00alis
Copy link
Contributor

00alis commented Apr 24, 2015

Here is the screenshot, even though it is not really helpful on non-retina displays. Anyway text should not pixelate at all.
screenshot 2015-04-24 10 13 12

@damellis @ricardojlrufino

The syntax highlighting look different. I believe we just deliberately chose colors for various kinds of keywords; do we want to change them again? The default font also looks different. Again, who should be deciding on these aspects?

We recently updated the syntax highlight of the Arduino code to match the 3 syntax groups we have (Functions, Structure and Variables). We are going to keep these new colors and keywords, because they have been carefully tested and approved. I don't see a difference in the default font, @damellis could you provide more details?
And I am taking care of this color highlight change, so let me know if you have any feedback on it. A couple of weeks ago we fixed the color of the error messages (was too dark).

Thanks!

@ffissore
Copy link
Contributor

@ricardojlrufino I'm working on some of the reported issues while constantly merging with master. I'm pushing my changes onto https://github.com/ffissore/Arduino/tree/1.6.4-new-editor

@ffissore
Copy link
Contributor

ATM I'm working on restoring keywords.txt color mappings

@ricardojlrufino
Copy link
Contributor Author

@ffissore Okay, I'll follow in your branche
The adjustments made in colors, was to maintain consistency with the look of the IDE, I think that it was good ...
@00alis If you need to change in fact, then we can turn the current on a new theme: 'bluesky'

@ricardojlrufino
Copy link
Contributor Author

@ffissore @00alis

TIP: To test color changes do not need restarting the IDE, just change the file and save your preferences again

@ffissore
Copy link
Contributor

@ricardojlrufino I've just rebased and force pushed on my branch https://github.com/ffissore/Arduino/tree/1.6.4-new-editor

In order to keep this PR in sync, please:

#fetch all modifications occured in the meanwhile
git fetch --all
#rebase your local copy (supposing remote is called upstream)
git rebase upstream/master
#merge my modifications (supposing remote is called ffissore)
git merge ffissore/1.6.4-new-editor
#force push onto your branch
git push -f origin 1.6.4-new-editor

ArduinoBot will take care of building a fresh IDE

@ffissore
Copy link
Contributor

As you can see, I've reverted two commits because they were either useless or changing a well documented/known behaviour/look&feel
I've also removed theme selection since we need to accustom to this new editor before squeezing every bit out of it.
I've also restored keywords.txt and theme.txt role into ruling which colors get used where, because this also is a known/documented feature

@damellis
Copy link
Contributor

Trying ffissore/Arduino/tree/1.6.4-new-editor, here are a few comments:

Alt-Backspace (to delete the word preceding the cursor) doesn't work. I think this is a Mac-specific keyboard shortcut, but it does work in the current 1.6.3 release.

URLs in comments are no longer clickable.

Code-folding isn't really useable unless line numbers are visible. Maybe if code-folding is enabled, the column next to the line numbers showing the code-folding icons should be visible, even if the line numbers themselves aren't?

I like the way that code-folding in Xcode shows the closing terminator (see screenshot). How hard would it be to do something like that?

screen shot 2015-04-27 at 3 28 28 pm

I find the Alt-Up and Alt-Down (to move the current line up and down) disconcerting. Also, on Mac those keyboard shortcuts have a different meaning (move up or down a paragraph). I'd suggest removing the line-moving behavior, at least on Mac.

Command-Up and Command-Down should go to the top or bottom of the editor on Mac, although this doesn't work in 1.6.3 either.

This version changes the behavior of the Command-Left key to go to the first non-whitespace character in the line instead of the first character in the line. I don't think there's a clear better option here (some people prefer one and some people the other) but this is a change that may trip up people who are used to the other behavior. (Of course, the current behavior may trip up people that are used to the opposite.)

In this version, the font and colors look the same as 1.6.3.

@damellis
Copy link
Contributor

Also, on Mac the standard is that Command-E uses the current selection for the find text, and that Command-F re-opens the search dialog without changing the find text to the current selection. It would be nice to stick to the standard.

@ricardojlrufino
Copy link
Contributor Author

@ffissore I did the merge !

@ffissore
Copy link
Contributor

@ArduinoBot build this please

@duff2013
Copy link
Contributor

Latest Build-251 (osx) hyperlinks are still not clickable, a.k.a not going to the website.

@ricardojlrufino
Copy link
Contributor Author

There are two alternatives:

  • Right click -> Open URL
  • Ctrl + Click

But I'll see how to enable by default ...

@PaulStoffregen
Copy link
Contributor

Looks like this isn't going to make it into the 1.6.4 release, is it?

@ffissore
Copy link
Contributor

ffissore commented May 5, 2015

@ArduinoBot build this please

@ffissore
Copy link
Contributor

ffissore commented May 5, 2015

Indeed no, it won't make it into 1.6.4, but we should be missing just proper Mac keyboard shortcuts. Merging this PR and gathering feedback through the nightly is the most conservative and secure approach at the moment

@PaulStoffregen
Copy link
Contributor

I'd really like to work on building some features on top of this work.... so my hope is this can get merged shortly after 1.6.4 releases.

Let's not hold up merging and allowing maximum time for community testing and feedback only because a couple keyboard shortcuts are missing on 1 platform.

@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Component: IDE user interface The Arduino IDE's user interface labels May 6, 2015
@ffissore ffissore self-assigned this May 7, 2015
@ffissore
Copy link
Contributor

ffissore commented May 7, 2015

Rebased and merged. See https://github.com/arduino/Arduino/commits/5bc6cee1185cf780a6e0445e43accf5842f515e8
Mac keyboards shortcuts issue will go into a separate issue

@j-s-com
Copy link

j-s-com commented May 11, 2015

The bug, that no UniCode Character is accepted when typed in the editor is still present in 1.6.4. You told me via mail that there is a new editor but the bug is the same. No äöü are accepted. Who tested this? I work with a Mac OS X 10.10.3 on a Mac Book Pro.

@ffissore
Copy link
Contributor

I haven't told you it was solved in 1.6.4. Indeed the fix is in the hourly build and will be released with 1.6.5

@j-s-com
Copy link

j-s-com commented May 12, 2015

Hello & thanx for the information.

It is always a little bit difficult for me because I use a Teensy 3.1 and
every time I install a new arduino I have to wait until the right Teensy
patch is available. I have very large projects and work with a Due, a Mega
2560 and a Teensy.

Best regards

Jörg Schreiber

Jörg Schreiber Consulting
Straßburger Str. 320
46045 Oberhausen

Telefon: 0208-880710
Telefax: 0208-880719
Mobil : 0151-23000449

Ust.-ID: DE212722362

http://www.jsob.de/
EMail: js@jsob.de

Von: Federico Fissore notifications@github.com
Antworten an: arduino/Arduino
<reply+00b75e29f6dcfe8ccd337d45e0fda10ee2aead05ef98ec0092cf00000001116966609
2a169ce042f7f7a@reply.github.com>
Datum: Dienstag, 12. Mai 2015 08:57
An: arduino/Arduino Arduino@noreply.github.com
Cc: Jörg Schreiber js@jsob.de
Betreff: Re: [Arduino] New Editor (based on RSyntaxTextArea ) - 1.6.4
(#3019)

I haven't told you it was solved in 1.6.4. Indeed the fix is in the hourly
build http://www.arduino.cc/en/Main/Software#hourly and will be released
with 1.6.5


Reply to this email directly or view it on GitHub
#3019 (comment) .

@j-s-com
Copy link

j-s-com commented May 12, 2015

Hi again,

I have another problem for some time:

I would like to make optional #includes, means on teensy I would like to
include i2cr3 and on Mega wire.h but this does not work. All #includes are
seen by the preprocessor, regardsless if the are in #if #endif or not. All
other things I need work in the #if/#endif.

The sense behind this is having a platform independent library for my
sketches.

Do you have a suggestion?

Best regards

Jörg Schreiber

Jörg Schreiber Consulting
Straßburger Str. 320
46045 Oberhausen

Telefon: 0208-880710
Telefax: 0208-880719
Mobil : 0151-23000449

Ust.-ID: DE212722362

http://www.jsob.de/
EMail: js@jsob.de

Von: Federico Fissore notifications@github.com
Antworten an: arduino/Arduino
<reply+00b75e29f6dcfe8ccd337d45e0fda10ee2aead05ef98ec0092cf00000001116966609
2a169ce042f7f7a@reply.github.com>
Datum: Dienstag, 12. Mai 2015 08:57
An: arduino/Arduino Arduino@noreply.github.com
Cc: Jörg Schreiber js@jsob.de
Betreff: Re: [Arduino] New Editor (based on RSyntaxTextArea ) - 1.6.4
(#3019)

I haven't told you it was solved in 1.6.4. Indeed the fix is in the hourly
build http://www.arduino.cc/en/Main/Software#hourly and will be released
with 1.6.5


Reply to this email directly or view it on GitHub
#3019 (comment) .

@ffissore
Copy link
Contributor

@j-s-com while I'm really happy to see you involved into the IDE development, please don't mix different issues into one. Issues are for bug and improvement proposal only. One issue, one bug/proposal. In your case, your issue is affecting many users. Please consider searching for existing issues before posting new ones

@PaulStoffregen
Copy link
Contributor

I would like to make optional #includes, means on teensy I would like to
include i2cr3 and on Mega wire.h but this does not work. All #includes are
seen by the preprocessor, regardsless if the are in #if #endif or not.

This is issue #2792, and also this conversation:

https://groups.google.com/a/arduino.cc/forum/#!topic/developers/JwdS_1Y8o-4

Those are probably the best place to talk of improving the preprocessing to discover build dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE user interface The Arduino IDE's user interface feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants