Remove unnecessary case statement braces.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4318 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2009-10-14 15:40:12 +00:00
parent 7b18977916
commit bb6526e717
2 changed files with 10 additions and 23 deletions

View File

@ -787,20 +787,17 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi
switch (nt->nmhdr.code) switch (nt->nmhdr.code)
{ {
case SCN_SAVEPOINTLEFT: case SCN_SAVEPOINTLEFT:
{
document_set_text_changed(doc, TRUE); document_set_text_changed(doc, TRUE);
break; break;
}
case SCN_SAVEPOINTREACHED: case SCN_SAVEPOINTREACHED:
{
document_set_text_changed(doc, FALSE); document_set_text_changed(doc, FALSE);
break; break;
}
case SCN_MODIFYATTEMPTRO: case SCN_MODIFYATTEMPTRO:
{
utils_beep(); utils_beep();
break; break;
}
case SCN_MARGINCLICK: case SCN_MARGINCLICK:
on_margin_click(sci, nt); on_margin_click(sci, nt);
break; break;
@ -810,13 +807,11 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi
break; break;
case SCN_MODIFIED: case SCN_MODIFIED:
{
if (editor_prefs.show_linenumber_margin && (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) && nt->linesAdded) if (editor_prefs.show_linenumber_margin && (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) && nt->linesAdded)
{ {
/* automatically adjust Scintilla's line numbers margin width */ /* automatically adjust Scintilla's line numbers margin width */
auto_update_margin_width(editor); auto_update_margin_width(editor);
} }
if (nt->modificationType & SC_STARTACTION && ! ignore_callback) if (nt->modificationType & SC_STARTACTION && ! ignore_callback)
{ {
/* get notified about undo changes */ /* get notified about undo changes */
@ -828,19 +823,18 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi
fold_changed(sci, nt->line, nt->foldLevelNow, nt->foldLevelPrev); fold_changed(sci, nt->line, nt->foldLevelNow, nt->foldLevelPrev);
} }
break; break;
}
case SCN_CHARADDED: case SCN_CHARADDED:
on_char_added(editor, nt); on_char_added(editor, nt);
break; break;
case SCN_USERLISTSELECTION: case SCN_USERLISTSELECTION:
{
if (nt->listType == 1) if (nt->listType == 1)
{ {
SSM(sci, SCI_ADDTEXT, strlen(nt->text), (sptr_t) nt->text); sci_add_text(sci, nt->text);
} }
break; break;
}
case SCN_AUTOCSELECTION: case SCN_AUTOCSELECTION:
if (g_str_equal(nt->text, "...")) if (g_str_equal(nt->text, "..."))
{ {
@ -850,34 +844,28 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi
} }
/* fall through */ /* fall through */
case SCN_AUTOCCANCELLED: case SCN_AUTOCCANCELLED:
{
/* now that autocomplete is finishing or was cancelled, reshow calltips /* now that autocomplete is finishing or was cancelled, reshow calltips
* if they were showing */ * if they were showing */
request_reshowing_calltip(nt); request_reshowing_calltip(nt);
break; break;
}
#ifdef GEANY_DEBUG #ifdef GEANY_DEBUG
case SCN_STYLENEEDED: case SCN_STYLENEEDED:
{
geany_debug("style"); geany_debug("style");
break; break;
}
#endif #endif
case SCN_NEEDSHOWN: case SCN_NEEDSHOWN:
{
ensure_range_visible(sci, nt->position, nt->position + nt->length, FALSE); ensure_range_visible(sci, nt->position, nt->position + nt->length, FALSE);
break; break;
}
case SCN_URIDROPPED: case SCN_URIDROPPED:
{
if (nt->text != NULL) if (nt->text != NULL)
{ {
document_open_file_list(nt->text, -1); document_open_file_list(nt->text, -1);
} }
break; break;
}
case SCN_CALLTIPCLICK: case SCN_CALLTIPCLICK:
{
if (nt->position > 0) if (nt->position > 0)
{ {
switch (nt->position) switch (nt->position)
@ -892,7 +880,6 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *object, GeanyEditor *edi
editor_show_calltip(editor, -1); editor_show_calltip(editor, -1);
} }
break; break;
}
} }
/* we always return FALSE here to let plugins handle the event too */ /* we always return FALSE here to let plugins handle the event too */
return FALSE; return FALSE;

View File

@ -164,7 +164,7 @@ void sci_convert_eols(ScintillaObject *sci, gint eolmode)
void sci_add_text(ScintillaObject *sci, const gchar *text) void sci_add_text(ScintillaObject *sci, const gchar *text)
{ {
if (text != NULL) if (text != NULL)
{ /* if null text is passed to scintilla will segfault */ { /* if null text is passed scintilla will segfault */
SSM(sci, SCI_ADDTEXT, strlen(text), (sptr_t) text); SSM(sci, SCI_ADDTEXT, strlen(text), (sptr_t) text);
} }
} }