diff --git a/src/ui/controls/edit.cpp b/src/ui/controls/edit.cpp index 5e4490ec..2fa9e8ab 100644 --- a/src/ui/controls/edit.cpp +++ b/src/ui/controls/edit.cpp @@ -2540,6 +2540,8 @@ bool CEdit::Paste() { char c; char* text; + int iTabToInsert=0; + int iTmp; //temp for tab space equivalant insertion if ( !m_bEdit ) { @@ -2554,20 +2556,36 @@ bool CEdit::Paste() } UndoMemorize(OPERUNDO_SPEC); - for ( unsigned int i = 0; i < strlen(text); i++ ) + for (unsigned int i = 0; iGetEditIndentValue()*iTabToInsert; iTmp>0; --iTmp) + InsertOne(' '); + iTabToInsert=0; } InsertOne(c); } - + if (0=m_len || '\n'!=m_text[m_cursor1])) + for (iTmp=m_engine->GetEditIndentValue() ; iTmp>0; --iTmp) + InsertOne(' '); SDL_free(text); Justif(); ColumnFix(); @@ -2872,7 +2890,7 @@ int CEdit::IndentTabCount() return nb; } -// Adds or removes qq tabs. +// Adds or removes some tabs. void CEdit::IndentTabAdjust(int number) {