Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-15 06:11:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-15 06:11:40 +0400
commit283ee53085b1e215cbd0d8af91b0000660406bfe (patch)
tree498c2640d15304d71268157af098f3f146f077b0 /source/blender/editors
parentcd8584aad56eb7fcc94dc4ebfbcde034aebbe3cd (diff)
fix for deleting lines hanging the text editor when no markers are used, presence of markers still hangs.
also compiler warnings and some style edits.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_text/text_ops.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 53e731bf2c4..105e20ffadb 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -1135,7 +1135,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
tmp = text->lines.first;
- //first convert to all space, this make it a lot easier to convert to tabs because there is no mixtures of ' ' && '\t'
+ /* first convert to all space, this make it a lot easier to convert to tabs
+ * because there is no mixtures of ' ' && '\t' */
while (tmp) {
text_check_line = tmp->line;
number = flatten_string(st, &fs, text_check_line) + 1;
@@ -1669,8 +1670,8 @@ static void txt_wrap_move_bol(SpaceText *st, ARegion *ar, short sel)
text_update_character_width(st);
- if (sel) linep = &text->sell, charp = &text->selc;
- else linep = &text->curl, charp = &text->curc;
+ if (sel) { linep = &text->sell; charp = &text->selc; }
+ else { linep = &text->curl; charp = &text->curc; }
oldc = *charp;
@@ -1735,8 +1736,8 @@ static void txt_wrap_move_eol(SpaceText *st, ARegion *ar, short sel)
text_update_character_width(st);
- if (sel) linep = &text->sell, charp = &text->selc;
- else linep = &text->curl, charp = &text->curc;
+ if (sel) { linep = &text->sell; charp = &text->selc; }
+ else { linep = &text->curl; charp = &text->curc; }
oldc = *charp;
@@ -1798,8 +1799,8 @@ static void txt_wrap_move_up(SpaceText *st, ARegion *ar, short sel)
text_update_character_width(st);
- if (sel) linep = &text->sell, charp = &text->selc;
- else linep = &text->curl, charp = &text->curc;
+ if (sel) { linep = &text->sell; charp = &text->selc; }
+ else { linep = &text->curl; charp = &text->curc; }
wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc);
col = text_get_char_pos(st, (*linep)->line, *charp) + offc;
@@ -1825,12 +1826,12 @@ static void txt_wrap_move_down(SpaceText *st, ARegion *ar, short sel)
Text *text = st->text;
TextLine **linep;
int *charp;
- int offl, offc, col, newl, visible_lines;
+ int offl, offc, col, visible_lines;
text_update_character_width(st);
- if (sel) linep = &text->sell, charp = &text->selc;
- else linep = &text->curl, charp = &text->curc;
+ if (sel) { linep = &text->sell; charp = &text->selc; }
+ else { linep = &text->curl; charp = &text->curc; }
wrap_offset_in_line(st, ar, *linep, *charp, &offl, &offc);
col = text_get_char_pos(st, (*linep)->line, *charp) + offc;
@@ -1860,8 +1861,8 @@ static void cursor_skip(SpaceText *st, ARegion *ar, Text *text, int lines, int s
TextLine **linep;
int *charp;
- if (sel) linep = &text->sell, charp = &text->selc;
- else linep = &text->curl, charp = &text->curc;
+ if (sel) { linep = &text->sell; charp = &text->selc; }
+ else { linep = &text->curl; charp = &text->curc; }
if (st && ar && st->wordwrap) {
int rell, relc;
@@ -2590,7 +2591,7 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
if (linep && charp != -1) {
if (sel) { text->sell = linep; text->selc = charp; }
- else { text->curl = linep; text->curc = charp; }
+ else { text->curl = linep; text->curc = charp; }
}
}
@@ -2615,7 +2616,7 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int
int w;
if (sel) { linep = &text->sell; charp = &text->selc; }
- else { linep = &text->curl; charp = &text->curc; }
+ else { linep = &text->curl; charp = &text->curc; }
y -= txt_get_span(text->lines.first, *linep) - st->top;