Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
8af2e7902d | |||
6459d11737 |
@@ -169,12 +169,10 @@ BufferText::BufferText(etk::FSNode &fileName)
|
|||||||
APPL_INFO("Add Data from file(" << GetFileName() << ")");
|
APPL_INFO("Add Data from file(" << GetFileName() << ")");
|
||||||
etk::FSNode myFile(fileName);
|
etk::FSNode myFile(fileName);
|
||||||
if (true == myFile.Exist()) {
|
if (true == myFile.Exist()) {
|
||||||
if (false == myFile.FileOpenRead()) {
|
if (false == m_EdnBuf.DumpFrom(myFile)) {
|
||||||
APPL_WARNING("File can not be open in read mode : " << myFile);
|
APPL_WARNING("File can not be open in read mode : " << myFile);
|
||||||
SetModify(true);
|
SetModify(true);
|
||||||
} else {
|
} else {
|
||||||
m_EdnBuf.DumpFrom(myFile);
|
|
||||||
myFile.FileClose();
|
|
||||||
SetModify(false);
|
SetModify(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -198,11 +196,9 @@ void BufferText::Save(void)
|
|||||||
{
|
{
|
||||||
APPL_INFO("Save File : \"" << GetFileName() << "\"" );
|
APPL_INFO("Save File : \"" << GetFileName() << "\"" );
|
||||||
etk::FSNode myFile(GetFileName());
|
etk::FSNode myFile(GetFileName());
|
||||||
if (false == myFile.FileOpenWrite()) {
|
if (false == m_EdnBuf.DumpIn(myFile)) {
|
||||||
APPL_ERROR("Can not open in writing the specify file");
|
APPL_ERROR("Can not open in writing the specify file");
|
||||||
} else {
|
} else {
|
||||||
m_EdnBuf.DumpIn(myFile);
|
|
||||||
myFile.FileClose();
|
|
||||||
SetModify(false);
|
SetModify(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,8 +405,8 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
if (currentChar!='\n') {
|
if (currentChar!='\n') {
|
||||||
selectColor = myColor;
|
selectColor = myColor;
|
||||||
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
|
HLColor = m_EdnBuf.GetElementColorAtPosition(m_displayLocalSyntax, iii);
|
||||||
if (NULL != HLColor) {
|
if (HLColor != NULL) {
|
||||||
if (NULL != HLColor->patern) {
|
if (HLColor->patern != NULL) {
|
||||||
selectColor = HLColor->patern->GetColor();
|
selectColor = HLColor->patern->GetColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -423,12 +419,12 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
OOText.SetColorBg(selectColor->GetBG() );
|
OOText.SetColorBg(selectColor->GetBG() );
|
||||||
} else {
|
} else {
|
||||||
if(false == selectColor->HaveBg()) {
|
if(false == selectColor->HaveBg()) {
|
||||||
if( (uniChar_t)' ' == currentChar
|
if( currentChar == ' '
|
||||||
&& true == globals::IsSetDisplaySpaceChar() )
|
&& globals::IsSetDisplaySpaceChar() == true )
|
||||||
{
|
{
|
||||||
OOText.SetColorBg(myColorSpace);
|
OOText.SetColorBg(myColorSpace);
|
||||||
} else if( '\t' == currentChar
|
} else if( currentChar == '\t'
|
||||||
&& true == globals::IsSetDisplayTabChar() )
|
&& globals::IsSetDisplayTabChar() == true )
|
||||||
{
|
{
|
||||||
OOText.SetColorBg(myColorTab);
|
OOText.SetColorBg(myColorTab);
|
||||||
}
|
}
|
||||||
@@ -488,6 +484,13 @@ int32_t BufferText::Display(ewol::Text& OOText,
|
|||||||
OOText.SetColorBg(ColorizeManager::Get(COLOR_CODE_CURSOR));
|
OOText.SetColorBg(ColorizeManager::Get(COLOR_CODE_CURSOR));
|
||||||
OOText.PrintCursor(ewol::GetCurrentSpecialKeyStatus().IsSetInsert());
|
OOText.PrintCursor(ewol::GetCurrentSpecialKeyStatus().IsSetInsert());
|
||||||
}
|
}
|
||||||
|
// Display the 80 colomn limit line :
|
||||||
|
|
||||||
|
OOText.SetClippingMode(false);
|
||||||
|
OOText.GetDrawing().SetThickness(2);
|
||||||
|
OOText.GetDrawing().SetColor(etk::Color<>(200,200,0,255));
|
||||||
|
OOText.GetDrawing().SetPos(vec2((float)((nbColoneForLineNumber+80)*tmpLetterSize.x()), 0.0f));
|
||||||
|
OOText.GetDrawing().LineRel(vec2(0.0f, 2500.0f));
|
||||||
// set the maximum size for the display ...
|
// set the maximum size for the display ...
|
||||||
SetMaximumSize(maxSize);
|
SetMaximumSize(maxSize);
|
||||||
int64_t stopTime2 = ewol::GetTime();
|
int64_t stopTime2 = ewol::GetTime();
|
||||||
|
@@ -34,7 +34,8 @@ static const char *ControlCodeTable[32] = {
|
|||||||
*/
|
*/
|
||||||
EdnBuf::EdnBuf(void)
|
EdnBuf::EdnBuf(void)
|
||||||
{
|
{
|
||||||
m_tabDist = 4;
|
// TODO : Set it configurable !!!
|
||||||
|
m_tabDist = 8;
|
||||||
m_useTabs = true;
|
m_useTabs = true;
|
||||||
|
|
||||||
// Current selection
|
// Current selection
|
||||||
@@ -501,7 +502,7 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, just return the character
|
// Otherwise, just return the character
|
||||||
if (false ==m_isUtf8) {
|
if (m_isUtf8 == false) {
|
||||||
convertIsoToUtf8(m_charsetType, c, outUTF8);
|
convertIsoToUtf8(m_charsetType, c, outUTF8);
|
||||||
pos++;
|
pos++;
|
||||||
} else {
|
} else {
|
||||||
@@ -514,10 +515,10 @@ int32_t EdnBuf::GetExpandedChar(int32_t &pos, int32_t indent, char outUTF8[MAX_E
|
|||||||
bool baseValid;
|
bool baseValid;
|
||||||
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
|
unicode::Utf8_SizeElement(tmpString, 6 , size, baseValid);
|
||||||
currentChar = 0; // TODO : Set UNICODE char ...
|
currentChar = 0; // TODO : Set UNICODE char ...
|
||||||
if (true == baseValid) {
|
if (baseValid == true) {
|
||||||
char *tmp = outUTF8;
|
char *tmp = outUTF8;
|
||||||
for (int32_t k=0; k<size; k++) {
|
for (int32_t kkk=0; kkk<size; kkk++) {
|
||||||
*tmp++ = tmpString[k];
|
*tmp++ = tmpString[kkk];
|
||||||
}
|
}
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user