[DEBUG] Correct some remove data in buffer error
This commit is contained in:
parent
fcb060c416
commit
7981763e4d
@ -309,8 +309,6 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
int32_t offsetX, int32_t offsetY,
|
int32_t offsetX, int32_t offsetY,
|
||||||
int32_t sizeX, int32_t sizeY)
|
int32_t sizeX, int32_t sizeY)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
int32_t selStart, selEnd, selRectStart, selRectEnd;
|
||||||
bool selIsRect;
|
bool selIsRect;
|
||||||
int32_t selHave;
|
int32_t selHave;
|
||||||
@ -328,7 +326,7 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
|
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
|
||||||
vec2 maxSize;
|
vec2 maxSize;
|
||||||
maxSize.x = 0.0;
|
maxSize.x = 0.0;
|
||||||
maxSize.y = m_EdnBuf.NumberOfLines() * letterHeight;
|
maxSize.y = m_EdnBuf.NumberOfLines() * tmpLetterSize.y;
|
||||||
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
|
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
|
||||||
|
|
||||||
// update the number of element that can be displayed
|
// update the number of element that can be displayed
|
||||||
|
@ -802,7 +802,7 @@ int32_t EdnBuf::CountLines(int32_t startPos, int32_t endPos)
|
|||||||
int32_t EdnBuf::CountLines(etk::Vector<int8_t> &data)
|
int32_t EdnBuf::CountLines(etk::Vector<int8_t> &data)
|
||||||
{
|
{
|
||||||
int32_t lineCount = 0;
|
int32_t lineCount = 0;
|
||||||
for(int32_t iii=0 ; iii<m_data.Size() ; iii++ ) {
|
for(int32_t iii=0 ; iii<data.Size() ; iii++ ) {
|
||||||
if ('\n' == data[iii]) {
|
if ('\n' == data[iii]) {
|
||||||
lineCount++;
|
lineCount++;
|
||||||
}
|
}
|
||||||
@ -1174,8 +1174,6 @@ void EdnBuf::eventModification(int32_t pos, int32_t nInserted, etk::Vector<int8_
|
|||||||
} else {
|
} else {
|
||||||
APPL_INFO("(pos="<<pos<<", nDeleted="<<deletedText.Size()<<", nInserted=" << nInserted << ", deletedText=\"xx???xx\");");
|
APPL_INFO("(pos="<<pos<<", nDeleted="<<deletedText.Size()<<", nInserted=" << nInserted << ", deletedText=\"xx???xx\");");
|
||||||
// update the number of lines :
|
// update the number of lines :
|
||||||
//CountNumberOfLines(); //==> not efficent methode ...
|
|
||||||
// ==> better methode : just update the number of line added and removed ...
|
|
||||||
//APPL_INFO(" add=" << CountLines(pos, pos+nInserted) << " lines | remove="<< CountLines(deletedText) << " lines");
|
//APPL_INFO(" add=" << CountLines(pos, pos+nInserted) << " lines | remove="<< CountLines(deletedText) << " lines");
|
||||||
m_nbLine += CountLines(pos, pos+nInserted) - CountLines(deletedText);
|
m_nbLine += CountLines(pos, pos+nInserted) - CountLines(deletedText);
|
||||||
// Update histories
|
// Update histories
|
||||||
|
Loading…
x
Reference in New Issue
Block a user