diff --git a/include/nana/deploy.hpp b/include/nana/deploy.hpp index 44d579c5..9b8cf203 100644 --- a/include/nana/deploy.hpp +++ b/include/nana/deploy.hpp @@ -125,8 +125,6 @@ namespace nana namespace nana { - bool is_incomplete(const nana::string& str, unsigned pos); - inline unsigned make_rgb(unsigned char red, unsigned char green, unsigned char blue) { diff --git a/source/deploy.cpp b/source/deploy.cpp index 06eefdd5..1c8fd611 100644 --- a/source/deploy.cpp +++ b/source/deploy.cpp @@ -427,27 +427,3 @@ namespace nana } } -namespace nana -{ - bool is_incomplete(const nana::string& str, unsigned pos) - { -#ifndef NANA_UNICODE - if(pos > str.size()) - pos = static_cast(str.size()); - const nana::char_t * pstr = str.c_str(); - if(pstr[pos] < 0) - { - bool incomp = false; - for(unsigned i = 0; i < pos; ++i) - { - if(pstr[i] < 0) - incomp = !incomp; - else - incomp = false; - } - return incomp; - } -#endif - return false; - } -} diff --git a/source/gui/widgets/skeletons/text_editor.cpp b/source/gui/widgets/skeletons/text_editor.cpp index daeab694..28849477 100644 --- a/source/gui/widgets/skeletons/text_editor.cpp +++ b/source/gui/widgets/skeletons/text_editor.cpp @@ -2183,15 +2183,8 @@ namespace nana{ namespace widgets unsigned erase_number = 1; --points_.caret.x; - const string_type& lnstr = textbase_.getline(points_.caret.y); -#ifndef NANA_UNICODE - if(is_incomplete(lnstr, points_.caret.x) && (points_.caret.x)) - { - textbase_.erase(points_.caret.y, points_.caret.x, 1); - --points_.caret.x; - erase_number = 2; - } -#endif + auto& lnstr = textbase_.getline(points_.caret.y); + undo_ptr->set_caret_pos(); undo_ptr->set_removed(lnstr.substr(points_.caret.x, erase_number)); auto secondary = behavior_->take_lines(points_.caret.y); @@ -2264,10 +2257,7 @@ namespace nana{ namespace widgets if(points_.caret.x) { --points_.caret.x; -#ifndef NANA_UNICODE - if(is_incomplete(textbase_.getline(points_.caret.y), points_.caret.x)) - --points_.caret.x; -#endif + pending = false; bool adjust_y = (attributes_.line_wrapped && behavior_->adjust_caret_into_screen()); if (_m_move_offset_x_while_over_border(-2) || adjust_y) @@ -2291,14 +2281,11 @@ namespace nana{ namespace widgets bool do_render = false; if(_m_cancel_select(2) == false) { - nana::string lnstr = textbase_.getline(points_.caret.y); + auto lnstr = textbase_.getline(points_.caret.y); if(lnstr.size() > points_.caret.x) { ++points_.caret.x; -#ifndef NANA_UNICODE - if(is_incomplete(lnstr, points_.caret.x)) - ++points_.caret.x; -#endif + bool adjust_y = (attributes_.line_wrapped && behavior_->adjust_caret_into_screen()); do_render = (_m_move_offset_x_while_over_border(2) || adjust_y); }