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

Update Scintilla to 5.3.7 and Lexilla to 5.2.7 #3551

Merged
merged 8 commits into from
Oct 4, 2023
Merged

Conversation

kugel-
Copy link
Member

@kugel- kugel- commented Sep 6, 2023

Notable changes since 5.1.5

  • multithreaded layouting and line wrapping. Neil says this can lead to dramatic improvements. Disabled by default, see SCI_SETLAYOUTTHREADS (i.e. we don't use it yet)
  • New APIs to support 64-bit document positions on Win32: SCI_GETSTYLEDTEXTFULL, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL We should move should move to these APIs, as the predecessors will be deprecated sooner or later. Not sure if it affects GTK-backend on win32 as well?
  • Change bar (probably similar to the git-changebar plugin)

@xiota
Copy link
Contributor

xiota commented Sep 13, 2023

@elextr
Copy link
Member

elextr commented Sep 16, 2023

@kugel- works for me, thanks for doing yet another Scintilla update, and with patch that @xiota cherry picked from Scintilla to avoid UB.

@elextr elextr mentioned this pull request Sep 16, 2023
@@ -21,6 +21,7 @@ fstring=string_1
fcharacter=character
ftriple=string_2
ftripledouble=string_2
attribute=identifier_1ö
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ö :)

@elextr
Copy link
Member

elextr commented Sep 17, 2023

As @kugel- pointed out elsewhere, this replaces #3441. So is the GDscript change on #3441 needed here as well?

Edit: just read #3441 where @kugel- answers the above question, just consider this a reminder then :-)

@elextr
Copy link
Member

elextr commented Sep 22, 2023

@kugel- don't forget this, fixes crasher in geany/geany-plugins#1272

@rdipardo
Copy link
Contributor

Handle new styles for strings in R (rawstrings, backticks, espaces

I would defer to @zufuliu's patch as being simpler and slightly optimizing the iteration count. IIUC, it's Geany's policy to only consume upstream patches anyway.

@elextr
Copy link
Member

elextr commented Sep 24, 2023

@rdipardo I don't understand, the commit by @kugel- is the mapping of lexer entities to styles within Geany, the patch by @zufuliu is to Scintilla, they are totally different and not interchangable?

@rdipardo
Copy link
Contributor

@elextr, yes, I see now the commit only touched filedefs (after expanding the diffs that GitHub's device fingerprinting scripts decided to collapse for my diminutive screen).

At least the Prolog enthusiasts now have a mentioned thread to follow, in case they want to know what's blocking #3171.

@rdipardo
Copy link
Contributor

Speaking of filedefs, has anyone had a chance to look at the suite of new properties the shell lexer acquired in recent versions? Most of them are for embedded variables, for example inside here docs:

scite-538-lex-bash

The command substitution preference also became a set of enumerated options:

lexer.bash.command.substitution Set how to highlight $() command substitution. 0 (the default) highlighted as backticks. 1 highlighted inside. 2 highlighted inside with extra scope tracking.
lexer.bash.nested.backticks Set this property to 0 to disable nested backquoted command substitution.
lexer.bash.styling.inside.backticks Set this property to 1 to highlight shell expansions inside backticks.
lexer.bash.styling.inside.heredoc Set this property to 1 to highlight shell expansions inside here document.
lexer.bash.styling.inside.parameter Set this property to 1 to highlight shell expansions inside ${} parameter expansion.
lexer.bash.styling.inside.string Set this property to 1 to highlight shell expansions inside string.

@elextr
Copy link
Member

elextr commented Sep 24, 2023

You should be able to set options in the [lexer_proterties] section of the filetype file, so you can try all those out and see what they do.

@kugel-
Copy link
Member Author

kugel- commented Sep 24, 2023

@kugel- don't forget this, fixes crasher in geany/geany-plugins#1272

Scintilla 5.3.7 was released including the fix. I'll bump to that version.

@kugel-
Copy link
Member Author

kugel- commented Sep 26, 2023

@eht16 do you know what's wrong with the Windows CI?

@kugel- kugel- changed the title Update Scintilla to version 5.3.6 Update Scintilla to 5.3.7 and Lexilla to 5.2.7 Sep 26, 2023
@kugel-
Copy link
Member Author

kugel- commented Sep 26, 2023

ScintillaOrg/lexilla#206 fixed after the 5.2.7 release. I did not backport the fix. I think R is not relevant enough to carry an additional change to Lexilla, or is it?

@elextr
Copy link
Member

elextr commented Sep 26, 2023

I think R is not relevant enough to carry an additional change to Lexilla, or is it?

I'm not sure "relevant" is well defined, thats a personal judgement depending if you use R :-). I would think only patches that fix crashes need to be carried outside Scintilla releases, thats the only reason I mentioned the one above.

@eht16
Copy link
Member

eht16 commented Sep 26, 2023

@eht16 do you know what's wrong with the Windows CI?

No :(.
I can succesfully build the image with normal Docker on a native Linux system. Either something changed on how the Gitlab runners are implemented or something in pacman/MSYS2 changed, still unsure what is causing this.
So far I didn't find any relevant information on the net. I'll try if it is enough to just create /etc/mtab.

@kugel-
Copy link
Member Author

kugel- commented Sep 27, 2023

I added a commit to enable the change history since it was trivial. Seems like a nice, user-visible change to take along (gives a bit of a modern feeling).

Before saving
before_save

After saving
after_save

@elextr
Copy link
Member

elextr commented Sep 27, 2023

@eht16 what version of g++/libstdc++ is used for windows, nowhere does the version get printed in configure or build, grrrr? The CI build is now running but failing when it can't find std::mutex (and yes Neil did #include <mutex>

#include <mutex>
). That is C++11 AFAIK so not sure why it fails unless you are using an ancient version of g++. I suspect Scintilla (not just Lexilla) now needs a real C++17 toolset.

@kugel-
Copy link
Member Author

kugel- commented Sep 27, 2023

AFAIK scintilla needs C++17 since version 4?

@elextr
Copy link
Member

elextr commented Sep 27, 2023

Yes, but there were "C++17 compliant(ish)" and "really C++17 compliant" versions of stdlibs. Scintilla didn't start using threading and futures and other concurrency features until these latest few versions, and older libraries might not support them. At least thats the only reason I can think of that it gives the current errors. But as I said Mutex is C++11 so it really should work by now.

@eht16
Copy link
Member

eht16 commented Sep 28, 2023

@eht16 what version of g++/libstdc++ is used for windows, nowhere does the version get printed in configure or build, grrrr?

In https://github.com/geany/geany/actions/runs/6322193707/job/17167381804?pr=3551#step:9:23 we show basic build environment information. Adding the gcc/g++ version is easy, maybe also the libstdc++ version as well. Anything else you are missing?
From the log of the image build, gcc 10.2 and libstdc++6 10.2 is used.

Is gcc 10 fine in general?
We could upgrade the Mingw64 build image to Debian Bookworm (currently Bullseye) to get newer gcc versions but on my last attempt this caused weired errors and so I decided to postpone it to after the release.

The CI build is now running

It's running only because I added a workaround in geany/infrastructure#10 to the image build which worked and I accidentally pushed the resulting image to the registry, so it can now be used for other builds. This is OK for the moment but I would still like to know the background of the /etc/mtab problem.

@elextr
Copy link
Member

elextr commented Sep 28, 2023

Is gcc 10 fine in general?

On an old machine (note to self: upgrade it) linux g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 works here (this PR builds and runs fine).

I really don't know what is wrong with the mingw build at this point.

Edit:

Adding the gcc/g++ version is easy, maybe also the libstdc++ version as well.

👍 Not aware of anything else.

@eht16
Copy link
Member

eht16 commented Oct 1, 2023

Is gcc 10 fine in general?

On an old machine (note to self: upgrade it) linux g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 works here (this PR builds and runs fine).

I really don't know what is wrong with the mingw build at this point.

Me neither.
geany/infrastructure#10 fixes the first problem with the Docker mingw64 image build. Since this is done now, I will test this PR on a real Windows system to see if it compiles there (I guess yes).

Adding the gcc/g++ version is easy, maybe also the libstdc++ version as well.

👍 Not aware of anything else.

Will do later.

@eht16
Copy link
Member

eht16 commented Oct 3, 2023

The build failures are not because the used compiler is too old but it's missing features: https://sourceforge.net/p/mingw-w64/bugs/959/

#3568 changes the used cross compiler toolchain to its "posix" variant which has all necessary C++ features and so the build will succeed.

I added there some more information about the used compiler to the build log.

@eht16
Copy link
Member

eht16 commented Oct 3, 2023

@kugel- @elextr should we include the patch from https://groups.google.com/g/scintilla-interest/c/_tiE_nSaiG4/m/v0e8lzTjAQAJ here?

I'd say yes because the next Scintilla release might be after the upcoming Geany release and the issue might also affect Geany users.

@kugel-
Copy link
Member Author

kugel- commented Oct 3, 2023

Apart from that (we can merge that patch individually if we agree on it), is there anything blocking?

The PR adds new string thanks to the change history feature so need to merge before the string freeze

@eht16
Copy link
Member

eht16 commented Oct 3, 2023

I'm fine with merge. The failed Windows CI build is handled seperately.

Only one minor thing, I guess we should bump plugin API version because GeanyIndentPrefs and Scintilla itself are part of the plugin API.

@elextr
Copy link
Member

elextr commented Oct 3, 2023

@eht16 did it build ok on "real" windows, preferably whatever is going to be used to make the release so we know that will be ok?

Otherwise I'm fine with it, it works for me on Linux.

@eht16
Copy link
Member

eht16 commented Oct 4, 2023 via email

@kugel-
Copy link
Member Author

kugel- commented Oct 4, 2023

Fine. I'll merge and bump the plugin API separately.

Regarding https://groups.google.com/g/scintilla-interest/c/_tiE_nSaiG4/m/v0e8lzTjAQAJ, I think it's a bit too early to jump on that patch. The problem seems to an extreme edge case and the proposed solution is not yet released or even in Scintilla mainline.

@elextr
Copy link
Member

elextr commented Oct 4, 2023

The problem seems to an extreme edge case and the proposed solution is not yet released or even in Scintilla mainline.

Yes agreed, and if it is a problem the changebars can be turned off in prefs.

Notable changes since 5.1.5
- multithreaded layouting and line wrapping. Neil says this can lead to dramatic
  improvements. Disabled by default, see SCI_SETLAYOUTTHREADS (i.e. we don't use it yet)
- New APIs to support 64-bit document positions on Win32:
  SCI_GETSTYLEDTEXTFULL, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL
  We should move should move to these APIs, as the predecessors will
  be deprecated sooner or later.
  Not sure if it affects GTK-backend on win32 as well?
- Change bar (will be enabled in a separate commit)

Also update Lexilla to 5.2.7, changes since 5.1.4:
- Tons of LexBash improvements
- Also numerous improvements to languages (Ruby, Matlab, F# and many more)
"attribute" is for highlighting object attributes or methods, i.e.
to style foo and bar differently in foo.bar.

Also set lexer properties to allow scintilla using different styles.

See ScintillaOrg/lexilla#49
Note:With escapes there is still an issue, thus we disable it for now
via lexer properties.

See also:
  ScintillaOrg/lexilla#206
While at it, fix annotation style. Somehow an earlier lexilla import
falsely used decorator in filetypes.gdscript.
We previously imported the README but did not keep it up-to-date.
This was adding noise to the diff to pristine scintilla.
Makes Geany feel a litttle bit more modern.

Can be enabled/disabled via Prefs. Default is to show the
change history in the markers margin.

Note: Scintilla tracks only its own change history and is not connected
to any VCS, unlike the git-changebar plugin. Also, change history is
lost when the document is closed and re-opened.
EditorPrefs was extended and scintilla was updated. Be helpful
and allow plugins to detect this.
@kugel- kugel- merged commit 4af1965 into geany:master Oct 4, 2023
3 of 4 checks passed
@b4n
Copy link
Member

b4n commented Oct 7, 2023

I added a commit to enable the change history since it was trivial. Seems like a nice, user-visible change to take along (gives a bit of a modern feeling).

I'm a tad late to the party (as usual), but I don't think it should be enabled by default. Here's a few reasons:

  • I've seen it do odd stuff (when I ^Zd a change on a line, it stayed green, yet didn't match the saved state), so I'm wondering if it's already stable enough… but maybe it's just because it matched one of the saved states of the file because I did save that previous state before!?
  • if you reload the file, everything becomes green…
  • if someone doesn't have the marker margin visible, background rendering is quite intrusive (especially after reloading the file 😉 )
  • I personally don't understand the point of the feature. Why would I want to see changes since the file was loaded? It's might be nice to see which lines aren't saved, but having everything since the file was loaded I don't understand the use case.
  • I think it's not entirely obvious what the feature is about if you don't know it. Meaning that if I just opened Geany, I could wonder what the heck was that thing.
  • Colors are a bit off with the default theme (or any for that matter), maybe we'd need some way to adjust that?

@b4n
Copy link
Member

b4n commented Oct 7, 2023

The problem seems to an extreme edge case

Not saying it's common, but AFAIR bulk search & replace will do that (potentially massively change lines from the end to the start)

@elextr
Copy link
Member

elextr commented Oct 8, 2023

I guess Neil added this because somebody wanted it. I can see that there are times when knowing what was changed in a session is useful. Since last save is maybe less useful since most IDEs have autosave and lots of people seem to like it.

But as @b4n points out there are operations that can produce unusable results when blindly recording lines edited since session start.

Other IDEs (the ones I tested) show diffs to git, not just the session, thats probably more useful. Maybe, depends how good the diff algorithm is, I'm sure we all have seen excessive github diffs for small changes.

Styling just needs "somebody" to add settings for the relevant marker and indicator types to the colour schemes files.

Anyway, its in Scintilla, we might as well make it available to users, the only question is by default or not. I don't have a strong feeling either way.

@eht16
Copy link
Member

eht16 commented Oct 8, 2023

After having used the change history for a few days now, I also think it might be better disabled by default so users should enable it explicitly if desired.

@kugel-
More importantly, we should document it. At the very least there should be a few lines describing the feature at https://github.com/geany/geany/blob/master/doc/geany.txt?plain=1#L2295.

I will take care of updated screenshots seperately.

@eht16
Copy link
Member

eht16 commented Oct 11, 2023

"Change history" docs will be added in #3593.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants