diff options
author | Ian Thompson <quornian@googlemail.com> | 2008-08-17 00:31:38 +0400 |
---|---|---|
committer | Ian Thompson <quornian@googlemail.com> | 2008-08-17 00:31:38 +0400 |
commit | 9b6dffad2d636e6e1c06845cd3114c2a40d9a413 (patch) | |
tree | 7c69953067e7796cf5b9b12c71424195ccd5e2ad /source/blender/blenkernel/intern/text.c | |
parent | 310a6e2179a9c55acbe3bdb833ff8420bd6eb216 (diff) |
Fixed problems with markers where Edit All did not behave the same for every marker and deleting selections that intersect markers did not remove the marker in all cases.
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 451642c4670..7802a1af1da 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -989,8 +989,12 @@ static void txt_delete_sel (Text *text) if (text->curl != text->sell) { txt_clear_marker_region(text, text->curl, text->curc, text->curl->len, 0); move= txt_get_span(text->curl, text->sell); - } else + } else { + mrk= txt_find_marker_region(text, text->curl, text->curc, text->selc, 0); + if (mrk->start > text->curc || mrk->end < text->selc) + txt_clear_marker_region(text, text->curl, text->curc, text->selc, 0); move= 0; + } mrk= txt_find_marker_region(text, text->sell, text->selc-1, text->sell->len, 0); if (mrk) { @@ -2394,8 +2398,12 @@ int txt_replace_char (Text *text, char add) if (!text->curl) return 0; /* If text is selected or we're at the end of the line just use txt_add_char */ - if (text->curc==text->curl->len || text->sell!=text->curl || text->selc!=text->curc || add=='\n') { - return txt_add_char(text, add); + if (text->curc==text->curl->len || txt_has_sel(text) || add=='\n') { + TextMarker *mrk; + int i= txt_add_char(text, add); + mrk= txt_find_marker(text, text->curl, text->curc, 0); + if (mrk && mrk->end==text->curc) mrk->end--; + return i; } del= text->curl->line[text->curc]; |