Revision: 2983
http://geany.svn.sourceforge.net/geany/?rev=2983&view=rev
Author: ntrel
Date: 2008-09-22 15:29:25 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
Rename get_indent() read_indent().
Fix possible overflow in auto_table().
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/editor.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-22 11:57:14 UTC (rev 2982)
+++ trunk/ChangeLog 2008-09-22 15:29:25 UTC (rev 2983)
@@ -8,8 +8,10 @@
* src/editor.c:
Fix HTML table autocompletion when the indent type is 'Tabs &
Spaces' (#2118289).
- Add some useful functions count_indent_size(),
- string_append_indent_width().
+ Add functions count_indent_size(), string_append_indent_width().
+ * src/editor.c:
+ Rename get_indent() read_indent().
+ Fix possible overflow in auto_table().
2008-09-21 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2008-09-22 11:57:14 UTC (rev 2982)
+++ trunk/src/editor.c 2008-09-22 15:29:25 UTC (rev 2983)
@@ -82,7 +82,6 @@
static void on_new_line_added(GeanyEditor *editor);
static gboolean handle_xml(GeanyEditor *editor, gchar ch);
-static void get_indent(GeanyEditor *editor, gint pos);
static void insert_indent_after_line(GeanyEditor *editor, gint line);
static void auto_multiline(GeanyEditor *editor, gint pos);
static gboolean is_code_style(gint lexer, gint style);
@@ -859,7 +858,7 @@
/* Read indent chars for the line that pos is on into indent global variable.
* Note: Use sci_get_line_indentation() and get_whitespace() instead in any new code. */
-static void get_indent(GeanyEditor *editor, gint pos)
+static void read_indent(GeanyEditor *editor, gint pos)
{
ScintillaObject *sci = editor->sci;
guint i, len, j = 0;
@@ -1569,7 +1568,7 @@
/* get the indentation */
if (editor->auto_indent)
- get_indent(editor, pos);
+ read_indent(editor, pos);
eol = g_strconcat(editor_get_eol_char(doc), indent, NULL);
construct = g_strdup_printf("%s\\end%s{%s}", eol, full_cmd, env);
@@ -1676,7 +1675,7 @@
return FALSE;
}
- get_indent(editor, pos);
+ read_indent(editor, pos);
lindent = g_strconcat(editor_get_eol_char(editor->document), indent, NULL);
whitespace = get_single_indent(editor);
@@ -1963,17 +1962,19 @@
if (SSM(sci, SCI_GETLEXER, 0, 0) != SCLEX_HTML) return;
- get_indent(editor, pos);
+ read_indent(editor, pos);
indent_pos = sci_get_line_indent_position(sci, sci_get_line_from_position(sci, pos));
if ((pos - 7) != indent_pos) /* 7 == strlen("<table>") */
{
- gint i, x;
+ gint i;
+ guint x;
+
x = strlen(indent);
/* find the start of the <table tag */
i = 1;
while (i <= pos && sci_get_char_at(sci, pos - i) != '<') i++;
/* add all non whitespace before the tag to the indent string */
- while ((pos - i) != indent_pos)
+ while ((pos - i) != indent_pos && x < sizeof(indent) - 1)
{
indent[x++] = ' ';
i++;
@@ -2345,7 +2346,7 @@
gint a = (first_line_was_comment) ? - co_len : co_len;
/* don't modify sel_start when the selection starts within indentation */
- get_indent(doc->editor, sel_start);
+ read_indent(doc->editor, sel_start);
if ((sel_start - first_line_start) <= (gint) strlen(indent))
a = 0;
@@ -2887,7 +2888,7 @@
if (editor->auto_indent &&
! have_multiline_comment && doc->file_type->comment_use_indent)
{
- get_indent(editor, editor_info.click_pos);
+ read_indent(editor, editor_info.click_pos);
text = g_strdup_printf("%s\n%s\n%s\n", indent, indent, indent);
text_len = strlen(text);
}
@@ -3099,8 +3100,13 @@
/* simple indentation to indent the current line with the same indent as the previous one */
static void smart_line_indentation(GeanyDocument *doc, gint first_line, gint last_line)
{
+ GeanyEditor *editor = doc->editor;
gint i, sel_start = 0, sel_end = 0;
+ /* get previous line and use it for read_indent to use that line
+ * (otherwise it would fail on a line only containing "{" in advanced indentation mode) */
+ read_indent(editor, sci_get_position_from_line(editor->sci, first_line - 1));
+
for (i = first_line; i <= last_line; i++)
{
/* skip the first line or if the indentation of the previous and current line are equal */
@@ -3145,10 +3151,6 @@
SSM(sci, SCI_BEGINUNDOACTION, 0, 0);
- /* get previous line and use it for get_indent to use that line
- * (otherwise it would fail on a line only containing "{" in advanced indentation mode) */
- get_indent(doc->editor, sci_get_position_from_line(sci, first_line - 1));
-
smart_line_indentation(doc, first_line, last_line);
/* set cursor position if there was no selection */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2980
http://geany.svn.sourceforge.net/geany/?rev=2980&view=rev
Author: eht16
Date: 2008-09-21 16:44:30 +0000 (Sun, 21 Sep 2008)
Log Message:
-----------
Fix broken indentation of automatic HTML table tag completion (part of #2118289).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/editor.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-21 16:43:45 UTC (rev 2979)
+++ trunk/ChangeLog 2008-09-21 16:44:30 UTC (rev 2980)
@@ -5,6 +5,9 @@
Move document_apply_update_prefs() in editor.c.
Refactor get_indent_guides_from_lexer() from sciwrappers.c in
editor_set_indentation_guides().
+ * src/editor.c:
+ Fix broken indentation of automatic HTML table tag completion
+ (part of #2118289).
2008-09-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2008-09-21 16:43:45 UTC (rev 2979)
+++ trunk/src/editor.c 2008-09-21 16:44:30 UTC (rev 2980)
@@ -1920,7 +1920,7 @@
}
/* get indent string for generated code */
- if (editor->auto_indent)
+ if (! editor->auto_indent)
indent_str = g_strdup("");
else
indent_str = get_single_indent(editor);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2975
http://geany.svn.sourceforge.net/geany/?rev=2975&view=rev
Author: ntrel
Date: 2008-09-19 16:30:04 +0000 (Fri, 19 Sep 2008)
Log Message:
-----------
Disable indent guides for the Diff filetype, as they can be
distracting as added/removed lines don't get them.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/sciwrappers.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-18 16:09:51 UTC (rev 2974)
+++ trunk/ChangeLog 2008-09-19 16:30:04 UTC (rev 2975)
@@ -1,3 +1,10 @@
+2008-09-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/sciwrappers.c:
+ Disable indent guides for the Diff filetype, as they can be
+ distracting as added/removed lines don't get them.
+
+
2008-09-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/ui_utils.c:
Modified: trunk/src/sciwrappers.c
===================================================================
--- trunk/src/sciwrappers.c 2008-09-18 16:09:51 UTC (rev 2974)
+++ trunk/src/sciwrappers.c 2008-09-19 16:30:04 UTC (rev 2975)
@@ -712,6 +712,13 @@
{
switch (lexer)
{
+ /* Lines added/removed are prefixed with +/- characters, so
+ * those lines will not be shown with any indentation guides.
+ * It can be distracting that only a few of lines in a diff/patch
+ * file will show the guides. */
+ case SCLEX_DIFF:
+ return SC_IV_NONE;
+
/* These languages use indentation for control blocks; the "look forward" method works
* best here */
case SCLEX_PYTHON:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2974
http://geany.svn.sourceforge.net/geany/?rev=2974&view=rev
Author: eht16
Date: 2008-09-18 16:09:51 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Handle error messages and warnings from the mcs (Mono) compiler like those from Pascal or Basic compilers.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/msgwindow.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-09-18 13:27:10 UTC (rev 2973)
+++ trunk/ChangeLog 2008-09-18 16:09:51 UTC (rev 2974)
@@ -6,6 +6,9 @@
No need to make the debugging strings translatable in the status bar.
* src/editor.c, src/plugins.c, src/sciwrappers.c, src/sciwrappers.h:
Rename the new indicator functions and add documentation comment.
+ * src/msgwindow.c:
+ Handle error messages and warnings from the mcs (Mono) compiler like
+ those from Pascal or Basic compilers.
2008-09-18 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c 2008-09-18 13:27:10 UTC (rev 2973)
+++ trunk/src/msgwindow.c 2008-09-18 16:09:51 UTC (rev 2974)
@@ -744,6 +744,7 @@
}
case GEANY_FILETYPES_BASIC:
case GEANY_FILETYPES_PASCAL:
+ case GEANY_FILETYPES_CS:
{
/* getdrive.bas(52) error 18: Syntax error in '? GetAllDrives'
* bandit.pas(149,3) Fatal: Syntax error, ";" expected but "ELSE" found */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.