Revision: 796
http://svn.sourceforge.net/geany/?rev=796&view=rev
Author: eht16
Date: 2006-09-06 10:53:58 -0700 (Wed, 06 Sep 2006)
Log Message:
-----------
Fixed a crash when a compiler output reports an error in a blank line.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-09-06 17:47:00 UTC (rev 795)
+++ trunk/ChangeLog 2006-09-06 17:53:58 UTC (rev 796)
@@ -4,6 +4,9 @@
Added own implementation of an Undo stack (not yet working).
* src/utils.c, src/document.c:
Convert tag names to UTF-8 before showing them in the sidebar.
+ * src/document.c:
+ Fixed a crash when a compiler output reports an error in a blank
+ line(can happen in LaTeX). Thanks to Frank for reporting.
2006-09-05 Enrico Tröger <enrico.troeger(a)uvena.de>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2006-09-06 17:47:00 UTC (rev 795)
+++ trunk/src/document.c 2006-09-06 17:53:58 UTC (rev 796)
@@ -1295,7 +1295,9 @@
end = sci_get_position_from_line(doc_list[idx].sci, line + 1);
// skip blank lines
- if ((start + 1) == end) return;
+ if ((start + 1) == end ||
+ sci_get_line_length(doc_list[idx].sci, line) == utils_get_eol_char_len(idx))
+ return;
len = end - start;
linebuf = g_malloc(len);
@@ -1312,6 +1314,7 @@
current_mask &= INDICS_MASK;
current_mask |= INDIC2_MASK;
sci_start_styling(doc_list[idx].sci, start + i, INDIC2_MASK);
+ //geany_debug("%p\tline: %d\tstart-end: %d - %d\t%d - %i", doc_list[idx].sci, line, start, end, len, i);
sci_set_styling(doc_list[idx].sci, len - i, current_mask);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 792
http://svn.sourceforge.net/geany/?rev=792&view=rev
Author: eht16
Date: 2006-09-05 11:33:48 -0700 (Tue, 05 Sep 2006)
Log Message:
-----------
Don't quit when an error occurs while saving changed files.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/dialogs.c
trunk/src/document.c
trunk/src/document.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-09-05 16:55:40 UTC (rev 791)
+++ trunk/ChangeLog 2006-09-05 18:33:48 UTC (rev 792)
@@ -2,6 +2,8 @@
* src/templates.c, src/document.c, src/filetypes.c:
Added new file template for filetype HTML.
+ * src/document.c, src/dialogs.c:
+ Don't quit when an error occurs while saving changed files.
2006-09-05 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c 2006-09-05 16:55:40 UTC (rev 791)
+++ trunk/src/dialogs.c 2006-09-05 18:33:48 UTC (rev 792)
@@ -313,10 +313,13 @@
case GTK_RESPONSE_YES:
{
if (doc_list[idx].file_name == NULL)
+ {
dialogs_show_save_as();
+ ret = TRUE;
+ }
else
- document_save_file(idx, FALSE);
- ret = TRUE;
+ // document_save_file() returns the status if the file could be saved
+ ret = document_save_file(idx, FALSE);
break;
}
case GTK_RESPONSE_NO: ret = TRUE; break;
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2006-09-05 16:55:40 UTC (rev 791)
+++ trunk/src/document.c 2006-09-05 18:33:48 UTC (rev 792)
@@ -676,22 +676,23 @@
/* This saves the file.
- * When force is set then it is always saved, even if it is unchanged(useful when using Save As) */
-void document_save_file(gint idx, gboolean force)
+ * When force is set then it is always saved, even if it is unchanged(useful when using Save As)
+ * It returns whether the file could be saved or not. */
+gboolean document_save_file(gint idx, gboolean force)
{
gchar *data;
FILE *fp;
gint bytes_written, len;
gchar *locale_filename = NULL;
- if (idx == -1) return;
- if (! force && ! doc_list[idx].changed) return;
+ if (idx == -1) return FALSE;
+ if (! force && ! doc_list[idx].changed) return FALSE;
if (doc_list[idx].file_name == NULL)
{
msgwin_status_add(_("Error saving file."));
utils_beep();
- return;
+ return FALSE;
}
// replaces tabs by spaces
@@ -739,7 +740,7 @@
geany_debug("encoding error: %s)", conv_error->message);
g_error_free(conv_error);
g_free(data);
- return;
+ return FALSE;
}
else
{
@@ -760,7 +761,7 @@
msgwin_status_add(_("Error saving file (%s)."), strerror(errno));
utils_beep();
g_free(data);
- return;
+ return FALSE;
}
bytes_written = fwrite(data, sizeof (gchar), len, fp);
fclose (fp);
@@ -771,7 +772,7 @@
{
msgwin_status_add(_("Error saving file."));
utils_beep();
- return;
+ return FALSE;
}
// ignore the following things if we are quitting
@@ -803,6 +804,7 @@
#endif
}
+ return TRUE;
}
Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h 2006-09-05 16:55:40 UTC (rev 791)
+++ trunk/src/document.h 2006-09-05 18:33:48 UTC (rev 792)
@@ -138,8 +138,9 @@
/* This saves the file.
- * When force is set then it is always saved, even if it is unchanged(useful when using Save As) */
-void document_save_file(gint, gboolean force);
+ * When force is set then it is always saved, even if it is unchanged(useful when using Save As)
+ * It returns whether the file could be saved or not. */
+gboolean document_save_file(gint idx, gboolean force);
/* special search function, used from the find entry in the toolbar */
void document_find_next(gint, const gchar*, gint, gboolean, gboolean);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 788
http://svn.sourceforge.net/geany/?rev=788&view=rev
Author: ntrel
Date: 2006-09-04 06:44:15 -0700 (Mon, 04 Sep 2006)
Log Message:
-----------
Update command-line options and running instance behaviour
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.docbook
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-09-04 11:16:07 UTC (rev 787)
+++ trunk/ChangeLog 2006-09-04 13:44:15 UTC (rev 788)
@@ -4,6 +4,8 @@
Rename --no-socket, -s command-line option to --new-instance, -i.
Add --no-session, -s command-line option to not load session files.
Only save session when session files were loaded at startup.
+ * doc/geany.docbook:
+ Update command-line options and running instance behaviour.
2006-09-03 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook 2006-09-04 11:16:07 UTC (rev 787)
+++ trunk/doc/geany.docbook 2006-09-04 13:44:15 UTC (rev 788)
@@ -239,6 +239,12 @@
</thead>
<tbody>
<row>
+ <entry>-s</entry>
+ <entry>--no-session</entry>
+ <entry>Don't load the previous session's files.
+ </entry>
+ </row>
+ <row>
<entry>-n</entry>
<entry>--no-ctags</entry>
<entry>Do not load auto completion and call tip data.
@@ -253,8 +259,8 @@
</entry>
</row>
<row>
- <entry>-p</entry>
- <entry>--no-pipe</entry>
+ <entry>-i</entry>
+ <entry>--new-instance</entry>
<entry>Do not open files in a running instance, force opening a new instance.
</entry>
</row>
@@ -329,20 +335,22 @@
on the compile time option GEANY_SESSION_FILES; the default is 15. For details see
<xref linkend="cto"/>.
</para>
- </section>
- <section id="general_fifo">
- <title>Detection of a running instance</title>
<para>
- &app; detects an already running instance of itself and opens new files in the already running one.
- So, you can use &app; like an editor to view and edit files by opening them from other
- programs. If you do not like this for some reason, you can disable it with the appropriate
- command line option.
+ You can start several instances of Geany, but only the first will load files
+ from the last session. To run a second instance of Geany, do not specify any
+ filenames on the command-line, or disable opening files in a running instance
+ using the appropriate command line option.
</para>
+ </section>
+ <section id="general_instance">
+ <title>Opening files from the command-line in a running instance</title>
<para>
- In the case that &app; crashed, you will get a message dialog at the next start,
- which asks you whether to delete an existing named pipe. If you are sure that there is
- no other instance of &app; is running, you can say Yes and &app; will start as usual.
- Otherwise click No and Geany will not start.
+ &app; detects an already running instance of itself and opens files from the
+ command-line in the already running instance.
+ So, &app; can be used to view and edit files by opening them from other
+ programs such as a file manager. If you do not like this for some reason,
+ you can disable using the first instance by using the appropriate command line
+ option - see <xref linkend="clo"/>.
</para>
</section>
<section id="general_vte">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.