You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot figure out where is the error. Could you ?
As I mentionned, the problem do not occure in the old version of TextEditor.cpp used in the ColorTextEditorDemo example.
EDIT: note that the problem is here even if you put a CR at the end of the string like "abcdef\n"
The problem is that the GetText creates 2 MLines because finds the last CR (the second one is empty). And when creating the complete string back, each MLine ouputs a CR at its ending. So 2 CR instead of 1...
The text was updated successfully, but these errors were encountered:
I also noticed the problem and it's definitely Bug !
I think correct way to fix it is to add one condition in place we adding new line characters.
In function: std::string TextEditor::GetText(const Coordinates & aStart, const Coordinates & aEnd) const
this part should be changed.
++lstart;
result += '\n';
And replaces with :
++lstart;
if(lstart < lend) result += '\n';
That way we do not add new line character for the last line.
Hi,
I noticed a strange behaviour, that is present in the main branch of your code, but not in the old one used in the demo/example.
Everytime you use SetText, a new line / CR is added at the end of the text.
example :
prints 6 , 7, 7 , 8...
I cannot figure out where is the error. Could you ?
As I mentionned, the problem do not occure in the old version of TextEditor.cpp used in the ColorTextEditorDemo example.
EDIT: note that the problem is here even if you put a CR at the end of the string like "abcdef\n"
The problem is that the GetText creates 2 MLines because finds the last CR (the second one is empty). And when creating the complete string back, each MLine ouputs a CR at its ending. So 2 CR instead of 1...
The text was updated successfully, but these errors were encountered: