When switching the current notebook tab, we need to take only visible
pages into account. If we don't and we try switching to an invisible
page, nothing happens.
In practice, the issue is visible on the message window notebook if one
of the tabs are hidden due to one of the "msgwin_*_visible" settings.
At commit 160e5e stamp was changed from a gchar[512] to a gchar*
but the copy loop still used stamp and sizeof(stamp) as the buffer.
Now gchar[512] buffer is used again.
Asciidoc overloads lines of dash (-) for heading underline and
open block delimiting (--). This made the parser recognise list
continuation blocks as headings. Now requires more than two
underline characters for a heading.
They used to be because their parent menu item (Editor) was
document-sensitive but now they are in the top of the View
menu they need to be invdividually made so.
TODO: should they really be/have been document-sensitive? They
can still change the pref without a document open and their
equivalent options in the Preferences dialog are not
document-sensitive? Same goes for existing "Change Font" item.
Rationale:
----------
* Existing View menu already contained Editor-related options
like "Change Font" and Zoom controls, so it makes sense to
group all of the View-related items together.
* Anecdotally, some users have been unable to easily discover
the Color Schemes changer dialog because it was nested under
a submenu.
* Distinction between "Editor" (Scintilla) and "Editor" (All
of Geany) is likely non-obvious to most users, especially
new users exploring the menus.
* There's not very many items to cause scrolling on low-res
monitors, and the View menu still has less items than the
Document menu.
Extract `split_line` function from `reflow_lines` to reimplement it in
the future without using SCI_SPLITLINES to achieve the
behaviour consistent with the "Line breaking" option.
* Unhardcode "pos" and "style" statusbar messages which were only
enabled when GEANY_DEBUG is defined and make them real possible
format chars.
* Move needless global "statusbar_template" into UIPrefs structure
with the other UI preferences, removing (now) pointless ui_finalize()
function.
* Rename "add_statusbar_statistics" to "create_statusbar_statistics"
and make it return a gchar* instead of passing in a GString argument
to update. Fixes a one-time "leak" of the GString and makes the code a
little easier to follow.
* Move the default statusbar template string to the top of the file
and use it as the default for the various preferences so the user has
something to base their customizations off of. TODO: check that the
N_() translations stuff works OK.
"regex_match_text" and "regex_matches" being globals, performing
several searches and then the replacements separately lead to them
having unexpected values, resulting in incorrect behavior and crash.
Fix this by removing the globals and instead make the search functions
return match details. Not only this fixes the issue, but also make the
code a lot more maintainable by not having globals introducing side
effects (proof of them being an issue is that c83a93e inadvertently
broke things bad).
Fix the selection start position after uncommenting if it was inside
the comment marker; and fix the selection end position if it was in
the indentation or before or inside the comment marker.
Improved fix for #3576431.
Instead of re-implementing the search-all algorithm everywhere it is
needed, move it to a re-usable function. This is useful because some
care is required to avoid improper rematches and endless loop, so
avoiding duplication is important (especially if something has to be
fixed someday).
Fix the search & replace algorithm to make sure a replacement won't
possibly affect the next one (e.g. in case of lookahead and lookbehind
regular expressions).
To do so, first find all occurrences and only then perform replacements,
instead of doing both together.
This fixes searching/replacing of any pattern that may be affected by
its replacement (e.g. patterns that look for something not a character
in the match range), including:
* Start/end of line:
Before this change, searching with regular expression "^A" and
replacing with an empty string on the input "AA" would have resulted
in an empty output ("^A" matching again after removing the first
one). Now it properly only removes the leading "A".
* Lookahead/lookbehind:
Pattern "(?<=a)b" with empty replacement and input "abb" would have
resulted in the output "a" instead of "ab".
* And more generally, many patterns matching non-characters like
positions or out-of-match characters.
The originally used SIGQUIT has problems:
1) see the deleted comment
2) some xterm alternatives ignore it, so they don't stop
Changed to SIGTERM which is the canonical "terminate" signal.
Removed associated unneeded ignore of SIGQUIT.
The last line doesn't have EOL characters, so computing
(line_length() - eol_length()) is wrong on the last line.
Instead, use (line_end_pos() - line_start_pos()) as suggests
Scintilla's documentation.
Closes PR#124