[DEV] undo & redo implemented
This commit is contained in:
parent
4c9fb8a74e
commit
29815eb46d
@ -10,9 +10,12 @@
|
|||||||
#include <appl/Buffer/TextPlugin.h>
|
#include <appl/Buffer/TextPlugin.h>
|
||||||
#include <appl/Debug.h>
|
#include <appl/Debug.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "TextViewerPlugin"
|
||||||
|
|
||||||
|
|
||||||
appl::TextViewerPlugin::TextViewerPlugin(void) :
|
appl::TextViewerPlugin::TextViewerPlugin(void) :
|
||||||
m_isEnable(false),
|
m_isEnable(true),
|
||||||
m_activateOnEventEntry(false),
|
m_activateOnEventEntry(false),
|
||||||
m_activateOnEventInput(false),
|
m_activateOnEventInput(false),
|
||||||
m_activateOnWrite(false),
|
m_activateOnWrite(false),
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#include <ewol/clipBoard.h>
|
#include <ewol/clipBoard.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "TextPluginAutoIndent"
|
||||||
|
|
||||||
|
|
||||||
appl::TextPluginAutoIndent::TextPluginAutoIndent(void) {
|
appl::TextPluginAutoIndent::TextPluginAutoIndent(void) {
|
||||||
m_activateOnEventEntry = true;
|
m_activateOnEventEntry = true;
|
||||||
@ -18,32 +21,32 @@ appl::TextPluginAutoIndent::TextPluginAutoIndent(void) {
|
|||||||
|
|
||||||
bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer,
|
bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer,
|
||||||
const ewol::EventEntry& _event) {
|
const ewol::EventEntry& _event) {
|
||||||
/*
|
if (isEnable() == false) {
|
||||||
if (enable == false) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
//APPL_DEBUG("KB EVENT : " << _event);
|
||||||
// just forward event == > manage directly in the buffer
|
// just forward event == > manage directly in the buffer
|
||||||
if (_event.getType() != ewol::keyEvent::keyboardChar) {
|
if (_event.getType() != ewol::keyEvent::keyboardChar) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//APPL_DEBUG("KB EVENT : \"" << UTF8_data << "\" size=" << strlen(UTF8_data) << "type=" << (int32_t)typeEvent);
|
|
||||||
if (_event.getStatus() != ewol::keyEvent::statusDown) {
|
if (_event.getStatus() != ewol::keyEvent::statusDown) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_event.getChar() != etk::UChar::Return) {
|
if (_event.getChar() != etk::UChar::Return) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_event.getSpecialKey().isSetShift() == false) {
|
if (_event.getSpecialKey().isSetShift() == true) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
appl::Buffer::Iterator startLine = _textDrawer.m_buffer->cursor();
|
appl::Buffer::Iterator startLine = _textDrawer.m_buffer->cursor();
|
||||||
if (_textDrawer.m_buffer->hasTextSelected() == true) {
|
if (_textDrawer.m_buffer->hasTextSelected() == true) {
|
||||||
startLine = _textDrawer.m_buffer->selectStart();
|
startLine = _textDrawer.m_buffer->selectStart();
|
||||||
}
|
}
|
||||||
|
startLine = _textDrawer.m_buffer->getStartLine(startLine);
|
||||||
etk::UString data = etk::UChar::Return;
|
etk::UString data = etk::UChar::Return;
|
||||||
|
|
||||||
for (appl::Buffer::Iterator it = startLine;
|
|
||||||
|
for (appl::Buffer::Iterator it = startLine+1;
|
||||||
it != _textDrawer.m_buffer->end();
|
it != _textDrawer.m_buffer->end();
|
||||||
++it) {
|
++it) {
|
||||||
if (*it == etk::UChar::Space) {
|
if (*it == etk::UChar::Space) {
|
||||||
@ -54,7 +57,6 @@ bool appl::TextPluginAutoIndent::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
APPL_DEBUG("kjhkjhkjhkjh : '" << data << "'");
|
|
||||||
_textDrawer.write(data);
|
_textDrawer.write(data);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#include <ewol/clipBoard.h>
|
#include <ewol/clipBoard.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "TextPluginCopy"
|
||||||
|
|
||||||
|
|
||||||
appl::TextPluginCopy::TextPluginCopy(void) {
|
appl::TextPluginCopy::TextPluginCopy(void) {
|
||||||
m_activateOnReceiveMessage = true;
|
m_activateOnReceiveMessage = true;
|
||||||
@ -30,7 +33,11 @@ void appl::TextPluginCopy::onPluginDisable(appl::TextViewer& _textDrawer) {
|
|||||||
// TODO : unknow function ...
|
// TODO : unknow function ...
|
||||||
}
|
}
|
||||||
|
|
||||||
bool appl::TextPluginCopy::onReceiveMessage(appl::TextViewer& _textDrawer, const ewol::EMessage& _msg) {
|
bool appl::TextPluginCopy::onReceiveMessage(appl::TextViewer& _textDrawer,
|
||||||
|
const ewol::EMessage& _msg) {
|
||||||
|
if (isEnable() == false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ( _msg.getMessage() == ednMsgGuiCopy
|
if ( _msg.getMessage() == ednMsgGuiCopy
|
||||||
|| _msg.getMessage() == ednMsgGuiCut) {
|
|| _msg.getMessage() == ednMsgGuiCut) {
|
||||||
if (_textDrawer.m_buffer != NULL) {
|
if (_textDrawer.m_buffer != NULL) {
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
#include <appl/Buffer/TextPluginCopy.h>
|
#include <appl/Buffer/TextPluginCopy.h>
|
||||||
#include <appl/Buffer/TextPluginMultiLineTab.h>
|
#include <appl/Buffer/TextPluginMultiLineTab.h>
|
||||||
#include <appl/Buffer/TextPluginAutoIndent.h>
|
#include <appl/Buffer/TextPluginAutoIndent.h>
|
||||||
|
#include <appl/Buffer/TextPluginHistory.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "textPluginManager"
|
||||||
|
|
||||||
static etk::Vector<appl::TextViewerPlugin *>& getList(void) {
|
static etk::Vector<appl::TextViewerPlugin *>& getList(void) {
|
||||||
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
static etk::Vector<appl::TextViewerPlugin *> s_list;
|
||||||
@ -73,6 +77,7 @@ void appl::textPluginManager::addDefaultPlugin(void) {
|
|||||||
appl::textPluginManager::addPlugin(new appl::TextPluginCopy());
|
appl::textPluginManager::addPlugin(new appl::TextPluginCopy());
|
||||||
appl::textPluginManager::addPlugin(new appl::TextPluginMultiLineTab());
|
appl::textPluginManager::addPlugin(new appl::TextPluginMultiLineTab());
|
||||||
appl::textPluginManager::addPlugin(new appl::TextPluginAutoIndent());
|
appl::textPluginManager::addPlugin(new appl::TextPluginAutoIndent());
|
||||||
|
appl::textPluginManager::addPlugin(new appl::TextPluginHistory());
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::textPluginManager::addPlugin(appl::TextViewerPlugin* _plugin) {
|
void appl::textPluginManager::addPlugin(appl::TextViewerPlugin* _plugin) {
|
||||||
|
@ -11,13 +11,18 @@
|
|||||||
#include <ewol/clipBoard.h>
|
#include <ewol/clipBoard.h>
|
||||||
#include <appl/Gui/TextViewer.h>
|
#include <appl/Gui/TextViewer.h>
|
||||||
|
|
||||||
|
#undef __class__
|
||||||
|
#define __class__ "TextPluginMultiLineTab"
|
||||||
|
|
||||||
appl::TextPluginMultiLineTab::TextPluginMultiLineTab(void) {
|
appl::TextPluginMultiLineTab::TextPluginMultiLineTab(void) {
|
||||||
m_activateOnEventEntry = true;
|
m_activateOnEventEntry = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
||||||
const ewol::EventEntry& _event) {
|
const ewol::EventEntry& _event) {
|
||||||
|
if (isEnable() == false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (_event.getType() != ewol::keyEvent::keyboardChar) {
|
if (_event.getType() != ewol::keyEvent::keyboardChar) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -84,7 +89,6 @@ bool appl::TextPluginMultiLineTab::onEventEntry(appl::TextViewer& _textDrawer,
|
|||||||
}
|
}
|
||||||
// Real replace of DATA :
|
// Real replace of DATA :
|
||||||
_textDrawer.replace(data, itStart, itStop);
|
_textDrawer.replace(data, itStart, itStop);
|
||||||
//_textDrawer.moveCursor(itStart);
|
|
||||||
_textDrawer.m_buffer->setSelectionPos(itStart+1);
|
_textDrawer.m_buffer->setSelectionPos(itStart+1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
@ -27,8 +27,6 @@ appl::TextViewer::TextViewer(const etk::UString& _fontName, int32_t _fontSize) :
|
|||||||
m_insertMode(false) {
|
m_insertMode(false) {
|
||||||
setCanHaveFocus(true);
|
setCanHaveFocus(true);
|
||||||
registerMultiCast(ednMsgBufferId);
|
registerMultiCast(ednMsgBufferId);
|
||||||
registerMultiCast(ednMsgGuiRedo);
|
|
||||||
registerMultiCast(ednMsgGuiUndo);
|
|
||||||
registerMultiCast(ednMsgGuiRm);
|
registerMultiCast(ednMsgGuiRm);
|
||||||
registerMultiCast(ednMsgGuiSelect);
|
registerMultiCast(ednMsgGuiSelect);
|
||||||
registerMultiCast(ednMsgGuiChangeCharset);
|
registerMultiCast(ednMsgGuiChangeCharset);
|
||||||
@ -146,10 +144,10 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
|||||||
}
|
}
|
||||||
// Display line number :
|
// Display line number :
|
||||||
m_lastOffsetDisplay = 0;
|
m_lastOffsetDisplay = 0;
|
||||||
|
vec3 tmpLetterSize = m_displayText.calculateSize((etk::UChar)'A');
|
||||||
{
|
{
|
||||||
esize_t nbLine = m_buffer->getNumberOfLines();
|
esize_t nbLine = m_buffer->getNumberOfLines();
|
||||||
float nbLineCalc = nbLine;
|
float nbLineCalc = nbLine;
|
||||||
vec3 tmpLetterSize = m_displayText.calculateSize((etk::UChar)'A');
|
|
||||||
int32_t nbChar = 0;
|
int32_t nbChar = 0;
|
||||||
while (nbLineCalc >= 1.0f) {
|
while (nbLineCalc >= 1.0f) {
|
||||||
++nbChar;
|
++nbChar;
|
||||||
@ -193,6 +191,13 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
|||||||
countNbLine += 1;
|
countNbLine += 1;
|
||||||
countColomn = 0;
|
countColomn = 0;
|
||||||
maxSizeX = etk_max(m_displayText.getPos().x(), maxSizeX);
|
maxSizeX = etk_max(m_displayText.getPos().x(), maxSizeX);
|
||||||
|
// display the end line position
|
||||||
|
if (it >= selectPosStart && it < selectPosStop) {
|
||||||
|
ewol::Drawing& draw = m_displayText.getDrawing();
|
||||||
|
draw.setColor(etk::Color<>(0xFF0000FF));
|
||||||
|
draw.setPos(m_displayText.getPos() + tmpLetterSize/4.0f);
|
||||||
|
draw.rectangle(m_displayText.getPos() + tmpLetterSize*3.0f/4.0f);
|
||||||
|
}
|
||||||
m_displayText.forceLineReturn();
|
m_displayText.forceLineReturn();
|
||||||
m_displayText.setPos(vec3(-m_originScrooled.x()+m_lastOffsetDisplay, m_displayText.getPos().y(), 0.0f));
|
m_displayText.setPos(vec3(-m_originScrooled.x()+m_lastOffsetDisplay, m_displayText.getPos().y(), 0.0f));
|
||||||
if (m_displayText.getPos().y() < -20.0f ) {
|
if (m_displayText.getPos().y() < -20.0f ) {
|
||||||
@ -200,11 +205,16 @@ void appl::TextViewer::onRegenerateDisplay(void) {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
m_displayText.setColorBg(etk::Color<>(0x00000000));
|
||||||
|
// TODO : move tis section in a plugin, but haw to do this ???
|
||||||
|
if (*it == etk::UChar::Space) {
|
||||||
|
m_displayText.setColorBg(etk::Color<>(0x00000022));
|
||||||
|
} else if (*it == etk::UChar::Tabulation) {
|
||||||
|
m_displayText.setColorBg(etk::Color<>(0x00000044));
|
||||||
|
}
|
||||||
m_buffer->expand(countColomn, currentValue, stringToDisplay);
|
m_buffer->expand(countColomn, currentValue, stringToDisplay);
|
||||||
if (it >= selectPosStart && it < selectPosStop) {
|
if (it >= selectPosStart && it < selectPosStop) {
|
||||||
m_displayText.setColorBg(etk::Color<>(0x00FF00FF));
|
m_displayText.setColorBg(etk::Color<>(0x00FF00FF));
|
||||||
} else {
|
|
||||||
m_displayText.setColorBg(etk::Color<>(0x00000000));
|
|
||||||
}
|
}
|
||||||
//APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'");
|
//APPL_DEBUG("display : '" << currentValue << "' == > '" << stringToDisplay << "'");
|
||||||
m_displayText.print(stringToDisplay);
|
m_displayText.print(stringToDisplay);
|
||||||
@ -254,7 +264,7 @@ bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) {
|
|||||||
} else if (localValue == etk::UChar::Suppress ) {
|
} else if (localValue == etk::UChar::Suppress ) {
|
||||||
//APPL_INFO("keyEvent : <suppr> pos=" << m_cursorPos);
|
//APPL_INFO("keyEvent : <suppr> pos=" << m_cursorPos);
|
||||||
if (m_buffer->hasTextSelected()) {
|
if (m_buffer->hasTextSelected()) {
|
||||||
m_buffer->removeSelection();
|
remove();
|
||||||
} else {
|
} else {
|
||||||
appl::Buffer::Iterator pos = m_buffer->cursor();
|
appl::Buffer::Iterator pos = m_buffer->cursor();
|
||||||
appl::Buffer::Iterator posEnd = pos;
|
appl::Buffer::Iterator posEnd = pos;
|
||||||
@ -265,14 +275,13 @@ bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) {
|
|||||||
} else if (localValue == etk::UChar::Delete) {
|
} else if (localValue == etk::UChar::Delete) {
|
||||||
//APPL_INFO("keyEvent : <del> pos=" << m_cursorPos);
|
//APPL_INFO("keyEvent : <del> pos=" << m_cursorPos);
|
||||||
if (m_buffer->hasTextSelected()) {
|
if (m_buffer->hasTextSelected()) {
|
||||||
m_buffer->removeSelection();
|
remove();
|
||||||
} else {
|
} else {
|
||||||
appl::Buffer::Iterator pos = m_buffer->cursor();
|
appl::Buffer::Iterator pos = m_buffer->cursor();
|
||||||
appl::Buffer::Iterator posEnd = pos;
|
appl::Buffer::Iterator posEnd = pos;
|
||||||
--pos;
|
--pos;
|
||||||
replace("", pos, posEnd);
|
replace("", pos, posEnd);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
m_buffer->setSelectMode(false);
|
m_buffer->setSelectMode(false);
|
||||||
@ -289,7 +298,6 @@ bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) {
|
|||||||
etk::UString myString = output;
|
etk::UString myString = output;
|
||||||
write(myString);
|
write(myString);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// move events ...
|
// move events ...
|
||||||
@ -332,7 +340,6 @@ bool appl::TextViewer::onEventEntry(const ewol::EventEntry& _event) {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
markToRedraw();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -489,15 +496,6 @@ void appl::TextViewer::onReceiveMessage(const ewol::EMessage& _msg) {
|
|||||||
markToRedraw();
|
markToRedraw();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_msg.getMessage() == ednMsgGuiUndo) {
|
|
||||||
if (m_buffer != NULL) {
|
|
||||||
//m_buffer->undo();
|
|
||||||
}
|
|
||||||
} else if (_msg.getMessage() == ednMsgGuiRedo) {
|
|
||||||
if (m_buffer != NULL) {
|
|
||||||
//m_buffer->redo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -526,6 +524,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
markToRedraw();
|
||||||
if (appl::textPluginManager::onCursorMove(*this, _pos) == true) {
|
if (appl::textPluginManager::onCursorMove(*this, _pos) == true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -547,12 +546,12 @@ bool appl::TextViewer::write(const etk::UString& _data, const appl::Buffer::Iter
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool ret = false;
|
markToRedraw();
|
||||||
if (appl::textPluginManager::onWrite(*this, _pos, _data) == true) {
|
if (appl::textPluginManager::onWrite(*this, _pos, _data) == true) {
|
||||||
ret = true;
|
// no call of the move cursor, because pluging might call theses function to copy and cut data...
|
||||||
} else {
|
return true;
|
||||||
ret = m_buffer->write(_data, _pos);
|
|
||||||
}
|
}
|
||||||
|
bool ret = m_buffer->write(_data, _pos);
|
||||||
appl::textPluginManager::onCursorMove(*this, m_buffer->cursor());
|
appl::textPluginManager::onCursorMove(*this, m_buffer->cursor());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -561,12 +560,12 @@ bool appl::TextViewer::replace(const etk::UString& _data, const appl::Buffer::It
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool ret = false;
|
markToRedraw();
|
||||||
if (appl::textPluginManager::onReplace(*this, _pos, _data, _posEnd) == true) {
|
if (appl::textPluginManager::onReplace(*this, _pos, _data, _posEnd) == true) {
|
||||||
ret = true;
|
// no call of the move cursor, because pluging might call theses function to copy and cut data...
|
||||||
} else {
|
return true;
|
||||||
ret = m_buffer->replace(_data, _pos, _posEnd);
|
|
||||||
}
|
}
|
||||||
|
bool ret = m_buffer->replace(_data, _pos, _posEnd);
|
||||||
appl::textPluginManager::onCursorMove(*this, m_buffer->cursor());
|
appl::textPluginManager::onCursorMove(*this, m_buffer->cursor());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -589,9 +588,11 @@ void appl::TextViewer::remove(void) {
|
|||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (appl::textPluginManager::onRemove(*this, m_buffer->selectStart(), m_buffer->selectStop()) == false) {
|
markToRedraw();
|
||||||
m_buffer->removeSelection();
|
if (appl::textPluginManager::onRemove(*this, m_buffer->selectStart(), m_buffer->selectStop()) == true) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
m_buffer->removeSelection();
|
||||||
appl::textPluginManager::onCursorMove(*this, m_buffer->cursor());
|
appl::textPluginManager::onCursorMove(*this, m_buffer->cursor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,6 +602,7 @@ void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
markToRedraw();
|
||||||
appl::Buffer::Iterator it;
|
appl::Buffer::Iterator it;
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
default:
|
default:
|
||||||
@ -623,6 +625,7 @@ void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
markToRedraw();
|
||||||
appl::Buffer::Iterator it;
|
appl::Buffer::Iterator it;
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
default:
|
default:
|
||||||
@ -645,6 +648,7 @@ void appl::TextViewer::moveCursorUp(esize_t _nbLine) {
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
markToRedraw();
|
||||||
// find the position of the start of the line.
|
// find the position of the start of the line.
|
||||||
appl::Buffer::Iterator lineStartPos = m_buffer->getStartLine(m_buffer->cursor());
|
appl::Buffer::Iterator lineStartPos = m_buffer->getStartLine(m_buffer->cursor());
|
||||||
// check if we can go up ...
|
// check if we can go up ...
|
||||||
@ -672,6 +676,7 @@ void appl::TextViewer::moveCursorDown(esize_t _nbLine) {
|
|||||||
if (m_buffer == NULL) {
|
if (m_buffer == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
markToRedraw();
|
||||||
// check if we are not at the end of Buffer
|
// check if we are not at the end of Buffer
|
||||||
if (m_buffer->cursor() == m_buffer->end() ) {
|
if (m_buffer->cursor() == m_buffer->end() ) {
|
||||||
return;
|
return;
|
||||||
|
@ -22,11 +22,13 @@ namespace appl {
|
|||||||
class TextPluginCopy;
|
class TextPluginCopy;
|
||||||
class TextPluginMultiLineTab;
|
class TextPluginMultiLineTab;
|
||||||
class TextPluginAutoIndent;
|
class TextPluginAutoIndent;
|
||||||
|
class TextPluginHistory;
|
||||||
class TextViewer : public widget::WidgetScrooled {
|
class TextViewer : public widget::WidgetScrooled {
|
||||||
friend class appl::TextViewerPlugin;
|
friend class appl::TextViewerPlugin;
|
||||||
friend class appl::TextPluginCopy;
|
friend class appl::TextPluginCopy;
|
||||||
friend class appl::TextPluginMultiLineTab;
|
friend class appl::TextPluginMultiLineTab;
|
||||||
friend class appl::TextPluginAutoIndent;
|
friend class appl::TextPluginAutoIndent;
|
||||||
|
friend class appl::TextPluginHistory;
|
||||||
public:
|
public:
|
||||||
TextViewer(const etk::UString& _fontName="", int32_t _fontSize=-1);
|
TextViewer(const etk::UString& _fontName="", int32_t _fontSize=-1);
|
||||||
virtual ~TextViewer(void);
|
virtual ~TextViewer(void);
|
||||||
|
@ -34,6 +34,7 @@ def Create(target):
|
|||||||
'appl/Buffer/TextPluginCopy.cpp',
|
'appl/Buffer/TextPluginCopy.cpp',
|
||||||
'appl/Buffer/TextPluginMultiLineTab.cpp',
|
'appl/Buffer/TextPluginMultiLineTab.cpp',
|
||||||
'appl/Buffer/TextPluginAutoIndent.cpp',
|
'appl/Buffer/TextPluginAutoIndent.cpp',
|
||||||
|
'appl/Buffer/TextPluginHistory.cpp',
|
||||||
'appl/Buffer/TextPluginManager.cpp',
|
'appl/Buffer/TextPluginManager.cpp',
|
||||||
'appl/Buffer/BufferManager.cpp'])
|
'appl/Buffer/BufferManager.cpp'])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user