[DEV] add ctags and select all plugin and correct the undo/redo plugin

This commit is contained in:
2013-11-25 22:18:06 +01:00
parent b79578b7e1
commit 4d999bbb67
14 changed files with 422 additions and 74 deletions

View File

@@ -261,7 +261,7 @@ MainWindows::MainWindows(void) {
shortCutAdd("ctrl+f", ednMsgGuiSearch, "", true);
shortCutAdd("F12", ednMsgGuiReloadShader, "", true);
shortCutAdd("ctrl+d", ednMsgGuiCtags, "Jump", true);
//shortCutAdd("ctrl+d", ednMsgGuiCtags, "Jump", true);

View File

@@ -35,16 +35,12 @@ appl::TextViewer::TextViewer(const std::string& _fontName, int32_t _fontSize) :
addObjectType("appl::TextViewer");
setCanHaveFocus(true);
registerMultiCast(ednMsgBufferId);
registerMultiCast(ednMsgGuiSelect);
registerMultiCast(ednMsgGuiFind);
registerMultiCast(ednMsgGuiReplace);
registerMultiCast(ednMsgGuiGotoLine);
registerMultiCast(appl::MsgSelectNewFile);
setLimitScrolling(0.2);
shortCutAdd("ctrl+a", ednMsgGuiSelect, "ALL");
shortCutAdd("ctrl+shift+a", ednMsgGuiSelect, "NONE");
// load buffer manager:
m_bufferManager = appl::BufferManager::keep();
m_viewerManager = appl::ViewerManager::keep();
@@ -60,15 +56,6 @@ appl::TextViewer::TextViewer(const std::string& _fontName, int32_t _fontSize) :
m_colorSelection = m_paintingProperties->request("SelectedText");
m_colorNormal = m_paintingProperties->request("normal");
// by default we load an example object:
/*
m_buffer = new appl::Buffer();
if (m_buffer == NULL) {
APPL_ERROR("can not create buffer ... ");
return;
}
m_buffer->loadFile("./example.txt");
*/
appl::textPluginManager::connect(*this);
// last created has focus ...
setCurrentSelect();

View File

@@ -37,8 +37,9 @@ namespace appl {
public:
TextViewer(const std::string& _fontName="", int32_t _fontSize=-1);
virtual ~TextViewer(void);
private:
public:
appl::Buffer* m_buffer; //!< pointer on the current buffer to display (can be null if the buffer is remover or in state of changing buffer)
private:
ewol::Text m_displayText; //!< Text display properties.
ewol::Drawing m_displayDrawing; //!< Other diaplay requested.
std::vector<std::pair<appl::Buffer*, vec2>> m_drawingRemenber;
@@ -266,6 +267,21 @@ namespace appl {
}
return ret;
}
/**
* @brief Get the position of selection around (select word).
* @param[in] _pos Position to start the selection.
* @param[out] _beginPos Position where the element start.
* @param[out] _endPos Position where the element stop.
* @return true if we find a selection around.
*/
bool getPosAround(const appl::Buffer::Iterator& _pos,
appl::Buffer::Iterator &_beginPos,
appl::Buffer::Iterator &_endPos) {
if (m_buffer==NULL) {
return false;
}
return m_buffer->getPosAround(_pos, _beginPos, _endPos);
}
/**
* @brief Get an iterator an an specific position
* @param[in] _pos Requested position of the iterator.