[DEBUG] correction of the tabulation error
This commit is contained in:
parent
50579a93a0
commit
0bef90462b
@ -40,7 +40,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
appl::Buffer::Iterator itStart = _textDrawer.m_buffer->selectStart();
|
appl::Buffer::Iterator itStart = _textDrawer.m_buffer->selectStart();
|
||||||
appl::Buffer::Iterator itStop = _textDrawer.m_buffer->selectStop();
|
appl::Buffer::Iterator itStop = _textDrawer.m_buffer->selectStop();
|
||||||
// get the compleate section of the buffer :
|
// get the compleate section of the buffer :
|
||||||
itStart = _textDrawer.m_buffer->getStartLine(itStart);
|
itStart = _textDrawer.m_buffer->getStartLine(itStart+1);
|
||||||
itStop = _textDrawer.m_buffer->getEndLine(itStop);
|
itStop = _textDrawer.m_buffer->getEndLine(itStop);
|
||||||
// copy the curent data in a classicle string:
|
// copy the curent data in a classicle string:
|
||||||
std::string data;
|
std::string data;
|
||||||
@ -57,13 +57,13 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(data[iii] == etk::UChar::Tabulation) {
|
if(data[iii] == etk::UChar::Tabulation) {
|
||||||
data.erase(iii);
|
data.erase(iii, 1);
|
||||||
} else if(data[iii] == etk::UChar::Space) {
|
} else if(data[iii] == etk::UChar::Space) {
|
||||||
for (esize_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) {
|
for (esize_t jjj=0; jjj<m_tabDist && jjj+iii<data.size() ; jjj++) {
|
||||||
if(data[iii] == etk::UChar::Space) {
|
if(data[iii] == etk::UChar::Space) {
|
||||||
data.erase(iii);
|
data.erase(iii, 1);
|
||||||
} else if(data[iii] == etk::UChar::Tabulation) {
|
} else if(data[iii] == etk::UChar::Tabulation) {
|
||||||
data.erase(iii);
|
data.erase(iii, 1);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@ -71,7 +71,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.erase(0);
|
data.erase(0, 1);
|
||||||
} else {
|
} else {
|
||||||
// indent
|
// indent
|
||||||
data.insert(0, 1, etk::UChar::Return);
|
data.insert(0, 1, etk::UChar::Return);
|
||||||
@ -87,7 +87,7 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
data.insert(iii, m_tabDist, etk::UChar::Space);
|
data.insert(iii, m_tabDist, etk::UChar::Space);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.erase(0);
|
data.erase(0, 1);
|
||||||
}
|
}
|
||||||
// Real replace of DATA :
|
// Real replace of DATA :
|
||||||
_textDrawer.replace(data, itStart, itStop);
|
_textDrawer.replace(data, itStart, itStop);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user