Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 3358
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: Fri May 03 04:44:03 CEST 2024

Total time taken to generate the page: 0.01727 seconds