When clicking a symbol in the Symbols sidebar and holding the Control modifier key, don't
set the focus to the editor widget so further navigation in the Symbols sidebar with keys
is possible.
When collapsing a fold range whose starting line is offscreen,
scroll the starting line to display at the top of the view.
Otherwise it can be confusing when the document scrolls down to hide
the folded lines.
Since reading locale and reading encodings from within files by regex
can find encodings not on the Geany list, saving as text ensures that
any encoding found can be saved in the session, otherwise a file can
be opened but will not re-open because the encoding cannot be saved
in the session. Since numeric encoding names exist prefix the text
name by 'E' so they can be distinguished from saved numeric indexes.
This ungetc() call don't look legitimate and actually leads to lots
of warnings about ungetc() being called when another character was
already backed up.
This removes tags like 'pass_', 'pass_stmt' or 'return_stmt' which are quite annoying
when typing the actual keywords and pressing Enter afterwards.
Also add some more modules and packages to the ignore list to avoid weird side effects
when importing them (even though antigravity is funny).
When reading a C macro, make sure to only use as much byes we actually
got and not as much as we requested. This should not be a problem
anymore now 61c5216 fixed a too long read, but it's safer anyway.
For all languages, this change allows comments at the end of the
checked line, e.g.:
if 42: # magic number
print("I'm indented!")
For languages with braces, it also properly indent if there is code
on the same line as the opening brace, e.g.:
if (42) { printf("some code here...");
printf("...but I'm properly indented");
} else { /* comment! */
printf("normal block is fine too, of course");
}
Although this is uncommon (and quite ugly) it's valid and should be
handled properly.
We used to draw the pages to print ourselves, but it is a tedious and
error-prone task (and we did made mistakes) that Scintilla would do
better by itself. So, rewrite the GTK (e.g. non-external) print code
to use Scintilla's built-in capabilities of drawing the buffer's
content on the pages.
Not only this makes the code a lot simpler and shorter, but it gives a
more accurate render (proper handling of tab stops, wrapping on word
boundaries, no missing character when a wrapped line spans on multiple
pages, ...), and it is noticeably faster (around 3 times).
Additionally we now paginate properly, which fixes printing starting
after page 1 or printing non-contiguous pages (we used to always print
starting from page 1 and counting, no matter what pages were selected).
However, note that obviously the render is not the same, even though
it's quite similar.
f4eb89cd7d79738a9c6c45e29abdd9d15d22e4fd was partially wrong and
removed legitimate re-matches when two different matches ends at the
same position. Particularly, the replacement changes are reverted.
Interestingly, Perl and Python does not agree on how to do such
replacements. Python does what I did in the above-cited commit, e.g.
doesn't replace twice if the match end overlaps, but Perl does.
Perl looks more legitimate here since both Python and Perl does find
the overlapping matches when performing a search, so Python is the odd
guy here doing it differently on replace than it does upon search.
For example, replacing using the pattern "a?(?=b)" and the replacement
string "_":
Python: ababcdb -> _b_bcd_b
Perl: ababcdb -> __b__bcd_b
But finding using the same pattern on the same input gives the same
results on both:
Python: ababcdb -> ['a', '', 'a', '', '']
Perl: ababcdb -> ['a', '', 'a', '', '']
Anyway, GLib and us claim to support "Perl-compatible regular
expressions", so we gotta follow Perl, especially in such doubtful
situations.