summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index d673f21077..4d87a6b3ba 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1119,6 +1119,19 @@ void TextEdit::_notification(int p_what) {
if ((char_ofs + char_margin) < xmargin_beg) {
char_ofs += char_w;
+
+ // line highlighting handle horizontal clipping
+ if (line == cursor.line && highlight_current_line) {
+ // char next to margin is skipped
+ if ((char_ofs + char_margin) > xmargin_beg) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, (char_ofs + char_margin) - (xmargin_beg + ofs_x), get_row_height()), cache.current_line_color);
+ }
+
+ // end of line when last char is skipped
+ if (j == str.length() - 1) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
+ }
+ }
continue;
}
@@ -4878,6 +4891,8 @@ void TextEdit::undo() {
else
undo_stack_pos = undo_stack_pos->prev();
+ deselect();
+
TextOperation op = undo_stack_pos->get();
_do_text_op(op, true);
current_op.version = op.prev_version;
@@ -4912,6 +4927,8 @@ void TextEdit::redo() {
if (undo_stack_pos == NULL)
return; //nothing to do.
+ deselect();
+
TextOperation op = undo_stack_pos->get();
_do_text_op(op, false);
current_op.version = op.version;