Commit ae33f230 authored by Naba Kumar's avatar Naba Kumar

Added MAX_STRING_LENGTH

	* src/an_symbol_view.c: Added MAX_STRING_LENGTH

	* tagmanager/tm_source_file.c, regex.c, parse.c:
	  defined and delimited g_messages within #debug.

	* src/preferences.c, data/anjuta.properties:
	  saved/defied message-manager tag position in string.
	  Message tag possition is saved between sessions. And
	  and tag position bottom as default.
parent 85cdb86d
2002-01-25 Naba Kumar <kh_naba@users.sourceforge.net>
* src/an_symbol_view.c: Added MAX_STRING_LENGTH
* tagmanager/tm_source_file.c, regex.c, parse.c:
defined and delimited g_messages within #debug.
* src/preferences.c, data/anjuta.properties:
saved/defied message-manager tag position in string.
Message tag possition is saved between sessions. And
and tag position bottom as default.
2002-01-25 Naba Kumar <kh_naba@users.sourceforge.net>
Patch submitted by:
......
......@@ -301,7 +301,7 @@ messages.color.messages1=#0000FF
messages.color.messages2=#000000
# Messages notebook tag position.
messages.tag.position=0
messages.tag.position=bottom
##################################################
# Folding #
......
......@@ -8,6 +8,8 @@
#include "an_symbol_view.h"
#define MAX_STRING_LENGTH 256
static SymbolFileInfo *symbol_file_info_new(TMSymbol *sym)
{
SymbolFileInfo *sfile = g_new0(SymbolFileInfo, 1);
......@@ -403,7 +405,7 @@ AnSymbolView *sv_populate(void)
goto clean_leave;
}
s = g_string_sized_new(255);
s = g_string_sized_new(MAX_STRING_LENGTH);
for (i=0; i < symbol_tree->info.children->len; ++i)
{
sym = TM_SYMBOL(symbol_tree->info.children->pdata[i]);
......
......@@ -487,10 +487,10 @@ preferences_sync (Preferences * pr)
str = preferences_get (pr, MESSAGES_TAG_POS);
if (str != NULL)
{
if (strcmp (str, "bottom") == 0)
if (strcmp (str, "top") == 0)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(pr->widgets.tag_pos_msg_radio[1]),
(pr->widgets.tag_pos_msg_radio[0]),
TRUE);
}
else if (strcmp (str, "left") == 0)
......@@ -508,14 +508,14 @@ preferences_sync (Preferences * pr)
else
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(pr->widgets.tag_pos_msg_radio[2]),
(pr->widgets.tag_pos_msg_radio[1]),
TRUE);
}
g_free (str);
}
else
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(pr->widgets.tag_pos_msg_radio[2]), TRUE);
(pr->widgets.tag_pos_msg_radio[1]), TRUE);
str = preferences_get(pr, MESSAGES_COLOR_ERROR);
if (str)
......@@ -790,8 +790,11 @@ gboolean preferences_save_yourself (Preferences * pr, FILE * fp)
fprintf (fp, "%s=%d\n", TRUNCAT_MESG_LAST,
preferences_get_int (pr, TRUNCAT_MESG_LAST));
fprintf (fp, "%s=%d\n", MESSAGES_TAG_POS,
preferences_get_int (pr, MESSAGES_TAG_POS));
str = preferences_get (pr, MESSAGES_TAG_POS);
if (str) {
fprintf (fp, "%s=%s\n", MESSAGES_TAG_POS, str);
g_free (str);
}
str = preferences_get (pr, MESSAGES_COLOR_ERROR);
fprintf (fp, "%s=%s\n", MESSAGES_COLOR_ERROR, str);
......
......@@ -1076,7 +1076,9 @@ tags_manager_set_filename (TagsManager * tm, gchar * fn)
{
if (tm->cur_file)
{
/* g_message("Files are %s and %s", tm->cur_file, fn); */
#ifdef DEBUG
g_message("Files are %s and %s", tm->cur_file, fn);
#endif
if (strcmp (tm->cur_file, extract_filename (fn)) == 0)
return;
}
......
......@@ -70,7 +70,9 @@ resolved_file_name(gchar *full_filename)
final_filename = g_strdup(real_filename);
else
final_filename = g_strdup(full_filename);
#ifdef DEBUG
g_message("%s -> %s", NSTR(full_filename), NSTR(final_filename));
#endif
return final_filename;
}
......
......@@ -627,22 +627,26 @@ extern boolean parseFile (const char *const fileName)
if (Option.language == LANG_AUTO)
language = getFileLanguage (fileName);
Assert (language != LANG_AUTO);
if (language == LANG_IGNORE)
verbose ("ignoring %s (unknown language)\n", fileName);
else if (! LanguageTable [language]->enabled)
verbose ("ignoring %s (language disabled)\n", fileName);
else
{
if (Option.filter)
openTagFile ();
tagFileResized = createTagsWithFallback (fileName, language);
if (Option.filter)
closeTagFile (tagFileResized);
addTotals (1, 0L, 0L);
return tagFileResized;
if (language == LANG_IGNORE) {
#ifdef DEBUG
verbose ("ignoring %s (unknown language)\n", fileName);
#endif
}
else if (! LanguageTable [language]->enabled) {
#ifdef DEBUG
verbose ("ignoring %s (language disabled)\n", fileName);
#endif
} else {
if (Option.filter)
openTagFile ();
tagFileResized = createTagsWithFallback (fileName, language);
if (Option.filter)
closeTagFile (tagFileResized);
addTotals (1, 0L, 0L);
return tagFileResized;
}
return tagFileResized;
}
......
......@@ -559,17 +559,20 @@ extern boolean processRegexOption (const char *const option,
if (dash != NULL && strncmp (option, "regex", dash - option) == 0)
{
#ifdef HAVE_REGEX
langType language;
language = getNamedLanguage (dash + 1);
if (language == LANG_IGNORE)
error (WARNING, "unknown language in --%s option", option);
else
processLanguageRegex (language, parameter);
langType language;
language = getNamedLanguage (dash + 1);
if (language == LANG_IGNORE) {
#ifdef DEBUG
error (WARNING, "unknown language in --%s option", option);
#endif
} else {
processLanguageRegex (language, parameter);
}
#else
error (WARNING, "regex support not available; required for --%s option",
option);
error (WARNING, "regex support not available; required for --%s option",
option);
#endif
handled = TRUE;
handled = TRUE;
}
return handled;
}
......
......@@ -110,12 +110,15 @@ gboolean tm_source_file_parse(TMSourceFile *source_file)
current_source_file = source_file;
if (LANG_AUTO == source_file->lang)
source_file->lang = getFileLanguage (file_name);
if (source_file->lang == LANG_IGNORE)
if (source_file->lang == LANG_IGNORE) {
#ifdef DEBUG
g_warning("ignoring %s (unknown language)\n", file_name);
else if (! LanguageTable [source_file->lang]->enabled)
#endif
} else if (! LanguageTable [source_file->lang]->enabled) {
#ifdef DEBUG
g_warning("ignoring %s (language disabled)\n", file_name);
else
{
#endif
} else {
int passCount = 0;
if (LanguageTable[source_file->lang]->initialize != NULL)
LanguageTable[source_file->lang]->initialize(source_file->lang);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment