From 3b4ea46ccae71668ed7c795e81a11565bb1b27bf Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Tue, 26 Dec 2006 01:30:30 +0000 Subject: [PATCH] Fixes, fixes, fixes... Originally committed to SVN as r619. --- core/subs_edit_ctrl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/subs_edit_ctrl.cpp b/core/subs_edit_ctrl.cpp index 1025e56c3..c822bd1b8 100644 --- a/core/subs_edit_ctrl.cpp +++ b/core/subs_edit_ctrl.cpp @@ -195,7 +195,7 @@ void SubsTextEditCtrl::UpdateStyle(int start, int _length) { // Is \n, \N or \h? if (curChar == _T('\\') && (nextChar == 'n' || nextChar == 'N' || nextChar == 'h')) { SetUnicodeStyling(curPos,ran,curStyle); - curPos += ran + 1; + curPos += ran; ran = 1; curStyle = 6; i++; @@ -670,6 +670,8 @@ wxString SubsTextEditCtrl::GetWordAtPosition(int pos) { void SubsTextEditCtrl::OnSplitLinePreserve (wxCommandEvent &event) { int from,to; GetSelection(&from, &to); + from = GetReverseUnicodePosition(from); + to = GetReverseUnicodePosition(to); control->grid->SplitLine(control->linen,from,0); } @@ -679,6 +681,8 @@ void SubsTextEditCtrl::OnSplitLinePreserve (wxCommandEvent &event) { void SubsTextEditCtrl::OnSplitLineEstimate (wxCommandEvent &event) { int from,to; GetSelection(&from, &to); + from = GetReverseUnicodePosition(from); + to = GetReverseUnicodePosition(to); control->grid->SplitLine(control->linen,from,1); }