Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 09 Apr 2014 16:14:36 UTC
Commit: de2eaa38abb982ab1539950ac4256359199f028c
https://github.com/geany/geany/commit/de2eaa38abb982ab1539950ac4256359199f0…
Log Message:
-----------
Update NEWS
Modified Paths:
--------------
NEWS
Modified: NEWS
6 files changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -15,6 +15,8 @@ Geany 1.24 (unreleased)
* Fix crash if a Custom Command returns after its related document
has been closed.
* Fix typo in "deque" C++ include name (#1027).
+ * Fix replacing a selection starting with "0x" by a color if the
+ selection is not 8 bytes long.
Interface
* Fix custom GTK styles under KDE (#3607935).
@@ -88,6 +90,10 @@ Geany 1.24 (unreleased)
Plugins
* Save Actions: add autosave when the editor lose focus (FR#683,
Steven Valsesia).
+ * Export: fix exporting a document not ending with a newline.
+ * Export: fix including random, unused styles in the output.
+ * Export: fix HTML title if the file name contains control characters.
+ * Export: fix LaTeX export with many consecutive '-', '<' or '>'.
API
* Add plugin_builder_connect_signals().
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 09 Apr 2014 16:07:30 UTC
Commit: 874c822328ed046cb15b4fe2d3dc7839eeac2b94
https://github.com/geany/geany/commit/874c822328ed046cb15b4fe2d3dc7839eeac2…
Log Message:
-----------
Export: don't include unused, random styles
Fix the bounds checking on included styles only to check for inclusion
actually defined styles, not to include random styles based on
uninitialized array indices.
Modified Paths:
--------------
plugins/export.c
Modified: plugins/export.c
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -544,7 +544,7 @@ static void write_latex_file(GeanyDocument *doc, const gchar *filename,
/* write used styles in the header */
cmds = g_string_new("");
- for (i = 0; i <= STYLE_MAX; i++)
+ for (i = 0; i < style_max; i++)
{
if (styles[i][USED])
{
@@ -737,7 +737,7 @@ static void write_html_file(GeanyDocument *doc, const gchar *filename,
"\tbody\n\t{\n\t\tfont-family: %s, monospace;\n\t\tfont-size: %dpt;\n\t}\n",
font_name, font_size);
- for (i = 0; i <= STYLE_MAX; i++)
+ for (i = 0; i < style_max; i++)
{
if (styles[i][USED])
{
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 09 Apr 2014 16:05:38 UTC
Commit: 4eb8205f5605e680f83ce062e7d03fcf2bc26c3e
https://github.com/geany/geany/commit/4eb8205f5605e680f83ce062e7d03fcf2bc26…
Log Message:
-----------
Export: don't try to read past the document end
A faulty bound checking resulted in reading a byte past the document
end, which resulted in Scintilla returning byte 0 because the position
was invalid. By adding this NUL byte to the string used to build the
body, the body was truncated after the last document byte (as C strings
are NUL-terminated), leading to any format structure after it to be
missing from the output.
This broke HTML and LaTeX export if the last line didn't end with a
newline, as the last line's style closing structure were missing.
Modified Paths:
--------------
plugins/export.c
Modified: plugins/export.c
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -393,7 +393,7 @@ static void write_latex_file(GeanyDocument *doc, const gchar *filename,
/* read the document and write the LaTeX code */
body = g_string_new("");
doc_len = sci_get_length(sci);
- for (i = 0; i <= doc_len; i++)
+ for (i = 0; i < doc_len; i++)
{
style = sci_get_style_at(sci, i);
c = sci_get_char_at(sci, i);
@@ -635,7 +635,7 @@ static void write_html_file(GeanyDocument *doc, const gchar *filename,
/* read the document and write the HTML body */
body = g_string_new("");
doc_len = sci_get_length(sci);
- for (i = 0; i <= doc_len; i++)
+ for (i = 0; i < doc_len; i++)
{
style = sci_get_style_at(sci, i);
c = sci_get_char_at(sci, i);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 09 Apr 2014 01:06:49 UTC
Commit: e135da8a79fa2a96d836b18159b535d0f7294ecd
https://github.com/geany/geany/commit/e135da8a79fa2a96d836b18159b535d0f7294…
Log Message:
-----------
Fix replacing colors with "0x" prefix with length different than 6
We used to assume that if the selected text started with "0x" when
inserting a color, we had to replace exactly 6 bytes after the "0x"
prefix. Although this is generally the case as most color formats use
6 hexadecimal digits, it still would erase either too many or too few
characters if actually replacing something shorter (i.e. "0xfff") or
longer (i.e. "0xffffffffffff").
It could even partially override multi-byte characters if the 8th byte
after the selection start was in the middle of a character, as the
length was in bytes and not characters.
Fix this by honoring the actual selection end.
Modified Paths:
--------------
src/editor.c
Modified: src/editor.c
6 files changed, 5 insertions(+), 1 deletions(-)
===================================================================
@@ -4164,8 +4164,12 @@ void editor_insert_color(GeanyEditor *editor, const gchar *colour)
if (sci_get_char_at(editor->sci, start) == '0' &&
sci_get_char_at(editor->sci, start + 1) == 'x')
{
+ gint end = sci_get_selection_end(editor->sci);
+
sci_set_selection_start(editor->sci, start + 2);
- sci_set_selection_end(editor->sci, start + 8);
+ /* we need to also re-set the selection end in case the anchor was located before
+ * the cursor, since set_selection_start() always moves the cursor, not the anchor */
+ sci_set_selection_end(editor->sci, end);
replacement++; /* skip the leading "0x" */
}
else if (sci_get_char_at(editor->sci, start - 1) == '#')
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).