Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 31 Jan 2015 17:44:10 UTC
Commit: d5cca3792269160d19530b3af1c63c880adef2d4
https://github.com/geany/geany/commit/d5cca3792269160d19530b3af1c63c880adef…
Log Message:
-----------
Change donate link to our own redirection
As discussed in #410, the previous SF redirect is better replaced by
a redirect on www.geany.org which we can control.
This way we can also quickly change the target URL if it changes at
Paypal.
Modified Paths:
--------------
src/geany.h
Modified: src/geany.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -45,7 +45,7 @@ G_BEGIN_DECLS
#define GEANY_HOMEPAGE "http://www.geany.org/"
#define GEANY_WIKI "http://wiki.geany.org/"
#define GEANY_BUG_REPORT "http://www.geany.org/Support/Bugs"
-#define GEANY_DONATE "https://sourceforge.net/donate/index.php?group_id=153444"
+#define GEANY_DONATE "http://www.geany.org/service/donate/"
#define GEANY_STRING_UNTITLED _("untitled")
#define GEANY_DEFAULT_DIALOG_HEIGHT 350
#define GEANY_WINDOW_DEFAULT_WIDTH 900
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 31 Jan 2015 15:11:48 UTC
Commit: 7229aa9cff84b6d42f75edba5b26babd2f6b8b64
https://github.com/geany/geany/commit/7229aa9cff84b6d42f75edba5b26babd2f6b8…
Log Message:
-----------
SaveActions: Set file permissions of backup copies to 0600
As discussed in SF bug #125, it might be dangerous to store backup
copies in a publicly accessable directory like /tmp with default
permissions, especially on multi-user systems.
So set the file permissions on non-Windows systems to 0600 by default.
Also improve the documentation of the save Actions plugin to reflect this
change.
Modified Paths:
--------------
doc/geany.txt
plugins/saveactions.c
Modified: doc/geany.txt
19 lines changed, 17 insertions(+), 2 deletions(-)
===================================================================
@@ -5176,8 +5176,23 @@ you can configure the automatically added extension in the configure dialog
in Geany's plugin manager.
After the plugin was loaded in Geany's plugin manager, every file is
-copied into the configured backup directory when the file is saved in Geany.
-
+copied into the configured backup directory *after* the file has been saved
+in Geany.
+
+The created backup copy file permissions are set to read-write only for
+the user. This should help to not create world-readable files on possibly
+unsecure destination directories like /tmp (especially useful
+on multi-user systems).
+This applies only to non-Windows systems. On Windows, no explicit file
+permissions are set.
+
+
+Additionally, you can define how many levels of the original file's
+directory structure should be replicated in the backup copy path.
+For example, setting the option
+*Directory levels to include in the backup destination* to *2*
+cause the plugin to create the last two components of the original
+file's path in the backup copy path and place the new file there.
Contributing to this document
Modified: plugins/saveactions.c
14 lines changed, 14 insertions(+), 0 deletions(-)
===================================================================
@@ -27,6 +27,8 @@
#include "geanyplugin.h"
#include "gtkcompat.h"
+#include <stdio.h>
+#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <glib/gstdio.h>
@@ -195,6 +197,7 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
gchar *dir_parts_src;
gchar *stamp;
gchar buf[512];
+ gint fd_dst = -1;
if (! enable_backupcopy)
return;
@@ -220,7 +223,14 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
g_free(basename_src);
g_free(dir_parts_src);
+#ifdef G_OS_WIN32
if ((dst = g_fopen(locale_filename_dst, "wb")) == NULL)
+#else
+ /* Use g_open() on non-Windows to set file permissions to 600 atomically.
+ * On Windows, seting file permissions would require specific Windows API. */
+ fd_dst = g_open(locale_filename_dst, O_CREAT | O_WRONLY, S_IWUSR | S_IRUSR);
+ if (fd_dst == -1 || (dst = fdopen(fd_dst, "w")) == NULL)
+#endif
{
ui_set_statusbar(FALSE, _("Backup Copy: File could not be saved (%s)."),
g_strerror(errno));
@@ -228,6 +238,8 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
g_free(locale_filename_dst);
g_free(stamp);
fclose(src);
+ if (fd_dst != -1)
+ close(fd_dst);
return;
}
@@ -238,6 +250,8 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
fclose(src);
fclose(dst);
+ if (fd_dst != -1)
+ close(fd_dst);
g_free(locale_filename_src);
g_free(locale_filename_dst);
g_free(stamp);
--------------
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, 28 Jan 2015 14:55:33 UTC
Commit: d33a23c40c4297c9ea8c2b53a4033a34db0cd10e
https://github.com/geany/geany/commit/d33a23c40c4297c9ea8c2b53a4033a34db0cd…
Log Message:
-----------
Add missing documentation for message window orientation setting
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -1973,6 +1973,12 @@ Show documents list
Position
Whether to place the sidebar on the left or right of the editor window.
+Message window
+``````````````
+
+Position
+ Whether to place the message window on the bottom or right of the editor window.
+
Fonts
`````
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Arthur Rosenstein <artros.misc(a)gmail.com>
Committer: Arthur Rosenstein <artros.misc(a)gmail.com>
Date: Sun, 10 Nov 2013 09:11:37 UTC
Commit: 322fa65ff555be84dee05761665fe87d0daa9432
https://github.com/geany/geany/commit/322fa65ff555be84dee05761665fe87d0daa9…
Log Message:
-----------
Maintain undo stack when reloading a document
Modified Paths:
--------------
src/document.c
Modified: src/document.c
75 lines changed, 72 insertions(+), 3 deletions(-)
===================================================================
@@ -1100,6 +1100,8 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
gchar *locale_filename = NULL;
GeanyFiletype *use_ft;
FileData filedata;
+ UndoReloadData *undo_reload_data;
+ gboolean add_undo_reload_action;
if (reload)
{
@@ -1157,8 +1159,31 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
monitor_file_setup(doc);
}
- sci_set_undo_collection(doc->editor->sci, FALSE); /* avoid creation of an undo action */
- sci_empty_undo_buffer(doc->editor->sci);
+ if (! reload || ! file_prefs.keep_edit_history_on_reload)
+ {
+ sci_set_undo_collection(doc->editor->sci, FALSE); /* avoid creation of an undo action */
+ sci_empty_undo_buffer(doc->editor->sci);
+ undo_reload_data = NULL;
+ }
+ else
+ {
+ undo_reload_data = (UndoReloadData*) g_malloc(sizeof(UndoReloadData));
+
+ /* We will be adding a UNDO_RELOAD action to the undo stack that undoes
+ * this reload. To do that, we keep collecting undo actions during
+ * reloading, and at the end add an UNDO_RELOAD action that performs
+ * all these actions in bulk. To keep track of how many undo actions
+ * were added during this time, we compare the current undo-stack height
+ * with its height at the end of the process. Note that g_trash_stack_height()
+ * is O(N), which is a little ugly, but this seems like the most maintainable
+ * option. */
+ undo_reload_data->actions_count = g_trash_stack_height(&doc->priv->undo_actions);
+
+ /* We use add_undo_reload_action to track any changes to the document that
+ * require adding an undo action to revert the reload, but that do not
+ * generate an undo action themselves. */
+ add_undo_reload_action = FALSE;
+ }
/* add the text to the ScintillaObject */
sci_set_readonly(doc->editor->sci, FALSE); /* to allow replacing text */
@@ -1167,11 +1192,28 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
/* detect & set line endings */
editor_mode = utils_get_line_endings(filedata.data, filedata.len);
+ if (undo_reload_data)
+ {
+ undo_reload_data->eol_mode = editor_get_eol_char_mode(doc->editor);
+ /* Force adding an undo-reload action if the EOL mode changed. */
+ if (editor_mode != undo_reload_data->eol_mode)
+ add_undo_reload_action = TRUE;
+ }
sci_set_eol_mode(doc->editor->sci, editor_mode);
g_free(filedata.data);
sci_set_undo_collection(doc->editor->sci, TRUE);
+ /* If reloading and the current and new encodings or BOM states differ,
+ * add appropriate undo actions. */
+ if (undo_reload_data)
+ {
+ if (! utils_str_equal(doc->encoding, filedata.enc))
+ document_undo_add(doc, UNDO_ENCODING, g_strdup(doc->encoding));
+ if (doc->has_bom != filedata.bom)
+ document_undo_add(doc, UNDO_BOM, GINT_TO_POINTER(doc->has_bom));
+ }
+
doc->priv->mtime = filedata.mtime; /* get the modification time from file and keep it */
g_free(doc->encoding); /* if reloading, free old encoding */
doc->encoding = filedata.enc;
@@ -1196,7 +1238,34 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
}
else
{ /* reloading */
- document_undo_clear(doc);
+ if (undo_reload_data)
+ {
+ /* Calculate the number of undo actions that are part of the reloading
+ * process, and add the UNDO_RELOAD action. */
+ undo_reload_data->actions_count =
+ g_trash_stack_height(&doc->priv->undo_actions) - undo_reload_data->actions_count;
+
+ /* We only add an undo-reload action if the document has actually changed.
+ * At the time of writing, this condition is moot because sci_set_text
+ * generates an undo action even when the text hasn't really changed, so
+ * actions_count is always greater than zero. In the future this might change.
+ * It's arguable whether we should add an undo-reload action unconditionally,
+ * especially since it's possible (if unlikely) that there had only
+ * been "invisible" changes to the document, such as changes in encoding and
+ * EOL mode, but for the time being that's how we roll. */
+ if (undo_reload_data->actions_count > 0 || add_undo_reload_action)
+ document_undo_add(doc, UNDO_RELOAD, undo_reload_data);
+ else
+ g_free(undo_reload_data);
+
+ /* We didn't save the document per-se, but its contents are now
+ * synchronized with the file on disk, hence set a save point here.
+ * We need to do this in this case only, because we don't clear
+ * Scintilla's undo stack. */
+ sci_set_savepoint(doc->editor->sci);
+ }
+ else
+ document_undo_clear(doc);
use_ft = ft;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Arthur Rosenstein <artros.misc(a)gmail.com>
Committer: Arthur Rosenstein <artros.misc(a)gmail.com>
Date: Sun, 10 Nov 2013 09:11:37 UTC
Commit: 660c441b4af272fe4e40eb6a6cda2badb8f17eac
https://github.com/geany/geany/commit/660c441b4af272fe4e40eb6a6cda2badb8f17…
Log Message:
-----------
Don't prompt for reload confirmation if keeping edit history
No work is lost in that case (except for the redo stack, which is
normal), so the extra confirmation step seems bothersome.
Modified Paths:
--------------
src/callbacks.c
Modified: src/callbacks.c
5 lines changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -428,8 +428,9 @@ G_MODULE_EXPORT void on_reload_as_activate(GtkMenuItem *menuitem, gpointer user_
charset = doc->encoding;
base_name = g_path_get_basename(doc->file_name);
- /* don't prompt if file hasn't been edited at all */
- if ((!doc->changed && !document_can_undo(doc) && !document_can_redo(doc)) ||
+ /* don't prompt if edit history is maintained, or if file hasn't been edited at all. */
+ if (file_prefs.keep_edit_history_on_reload ||
+ (!doc->changed && !document_can_undo(doc) && !document_can_redo(doc)) ||
dialogs_show_question_full(NULL, _("_Reload"), GTK_STOCK_CANCEL,
_("Any unsaved changes will be lost."),
_("Are you sure you want to reload '%s'?"), base_name))
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Arthur Rosenstein <artros.misc(a)gmail.com>
Committer: Arthur Rosenstein <artros.misc(a)gmail.com>
Date: Sun, 10 Nov 2013 09:11:36 UTC
Commit: 6f6dfda8a8e6af4a84897db543885a9261481ba4
https://github.com/geany/geany/commit/6f6dfda8a8e6af4a84897db543885a9261481…
Log Message:
-----------
Add documentation for keep_edit_history_on_reload option
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
6 lines changed, 4 insertions(+), 2 deletions(-)
===================================================================
@@ -2604,6 +2604,9 @@ use_gio_unsafe_file_saving Whether to use GIO as the unsafe file t
correctly on some complex setups.
gio_unsafe_save_backup Make a backup when using GIO unsafe file false immediately
saving. Backup is named `filename~`.
+keep_edit_history_on_reload Whether to maintain the edit history when true immediately
+ reloading a file, and allow the operation
+ to be reverted.
**Filetype related**
extract_filetype_regex Regex to extract filetype name from file See below. immediately
via capture group one.
@@ -3306,8 +3309,7 @@ Close all Ctrl-Shift-W Closes all open files.
Close Ctrl-W (C) Closes the current file.
-Reload file Ctrl-R (C) Reloads the current file. All unsaved changes
- will be lost.
+Reload file Ctrl-R (C) Reloads the current file.
Print Ctrl-P (C) Prints the current file.
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).