diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-09 07:46:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-09 07:46:30 +0400 |
commit | ddddb7bab173b040342ef99270ee71ae076d45e8 (patch) | |
tree | 1d2f91c15982ff3ce1d4431d9a96b1277e50d84d /source/blender/editors/space_text/text_ops.c | |
parent | 9e1ead1940f084c24b3751a1a52e40f40c3c4df1 (diff) |
code cleanup: favor braces when blocks have mixed brace use.
Diffstat (limited to 'source/blender/editors/space_text/text_ops.c')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index b45961bff11..e6f95c39baf 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1413,7 +1413,9 @@ static int text_get_cursor_rel(SpaceText *st, ARegion *ar, TextLine *linein, int chars = st->tabnumber - i % st->tabnumber; ch = ' '; } - else chars = 1; + else { + chars = 1; + } while (chars--) { if (rell == 0 && i - start == relc) { @@ -1591,7 +1593,9 @@ static void txt_wrap_move_bol(SpaceText *st, ARegion *ar, short sel) chars = st->tabnumber - i % st->tabnumber; ch = ' '; } - else chars = 1; + else { + chars = 1; + } while (chars--) { if (i - start >= max) { @@ -1657,7 +1661,9 @@ static void txt_wrap_move_eol(SpaceText *st, ARegion *ar, short sel) chars = st->tabnumber - i % st->tabnumber; ch = ' '; } - else chars = 1; + else { + chars = 1; + } while (chars--) { if (i - start >= max) { @@ -1716,7 +1722,9 @@ static void txt_wrap_move_up(SpaceText *st, ARegion *ar, short sel) visible_lines = text_get_visible_lines(st, ar, (*linep)->line); *charp = text_get_cursor_rel(st, ar, *linep, visible_lines - 1, col); } - else *charp = 0; + else { + *charp = 0; + } } if (!sel) txt_pop_sel(text); @@ -1745,7 +1753,9 @@ static void txt_wrap_move_down(SpaceText *st, ARegion *ar, short sel) *linep = (*linep)->next; *charp = text_get_cursor_rel(st, ar, *linep, 0, col); } - else *charp = (*linep)->len; + else { + *charp = (*linep)->len; + } } if (!sel) txt_pop_sel(text); @@ -2350,7 +2360,9 @@ static int flatten_len(SpaceText *st, const char *str) if (str[i] == '\t') { total += st->tabnumber - total % st->tabnumber; } - else total++; + else { + total++; + } } return total; @@ -2412,7 +2424,9 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in chars = st->tabnumber - i % st->tabnumber; ch = ' '; } - else chars = 1; + else { + chars = 1; + } while (chars--) { /* Gone too far, go back to last wrap point */ |