U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Problem in CodeEditor
Problem in CodeEditor [message #39138] Mon, 18 February 2013 14:57 Go to previous message
koldo is currently offline  koldo
Messages: 3461
Registered: August 2008
Senior Veteran
Hello Mirek

I get an error using CodeEditor when pasting a text in an empty CodeEditor.

With line == 0, as li is empty,

void EditorBar::ClearErrors(int line)
{
	int count;
	if(line < 0) {
		line = 0;
		count = li.GetCount();
	}
	else
		count = line + 1;

	for(int i = line; i < count; i++)
		li[i].error = 0;	// Assert here
}


A possible solution could be this:

void EditorBar::ClearErrors(int line)
{
	int count;
	if(line < 0) {
		line = 0;
		count = li.GetCount();
	}
	else if (line >= li.GetCount())	// Added
		count = li.GetCount();
	else
		count = line + 1;

	for(int i = line; i < count; i++)
		li[i].error = 0;
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Previous Topic: Solved: How to use WhenCancel callback for DropList
Next Topic: autocomplete editbox
Goto Forum:
  


Current Time: Thu Sep 24 19:29:36 GMT+2 2026

Total time taken to generate the page: 0.01629 seconds