SYS : Indent with TAB only when multiple line selected

This commit is contained in:
Edouard Dupin 2011-09-06 09:11:51 +02:00
parent e48c75df72
commit 2714560c38
3 changed files with 16 additions and 23 deletions

View File

@ -968,10 +968,20 @@ void BufferText::AddChar(char * UTF8data)
m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+1, true);
} else {
if (true == globals::IsSetShift() ) {
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY);
// Indent depend of the multiline in the selection ...
// count the number of line :
int32_t nbSelectedLines = m_EdnBuf.CountLines(SelectionStart, SelectionEnd);
if (0 == nbSelectedLines) {
Edn::VectorType<int8_t> tmpVect;
tmpVect.PushBack(0x09);
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
} else {
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY);
if (true == globals::IsSetShift() ) {
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY);
} else {
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY);
}
}
}
actionDone = true;

View File

@ -339,25 +339,8 @@ gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, g
//EDN_INFO(" plop %d / %d = %d ==> %d", (uint32_t)event->y, fontHeight, ((uint32_t)event->y / fontHeight), selectBuf);
if ( 0 <= selectBuf) {
self->SendMessage(EDN_MSG__CURRENT_CHANGE_BUFFER_ID, selectBuf);
/*
MainWindows *window = MainWindows::getInstance();
EDN_INFO(" Event on Buffer " << selectBuf);
// set the new seected Buffer
window->SetSelected(selectBuf);
*/
}
}/* else if (event->type == GDK_3BUTTON_PRESS) {
EDN_INFO("mouse-event BT1 ==> Triple Clicked");
}else if (event->type == GDK_BUTTON_RELEASE) {
EDN_INFO("mouse-event BT1 ==> Realease");
}*/
} else if (event->button == 2) {
/*
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT2 PRESS");
self->m_menuContext->Show(event->x, event->y, false);
}
*/
} else if (event->button == 3) {
if (event->type == GDK_BUTTON_PRESS) {
EDN_INFO("mouse-event BT3 PRESS");
@ -368,7 +351,8 @@ gint BufferView::CB_mouseButtonEvent(GtkWidget *widget, GdkEventButton *event, g
}
}
} else {
EDN_INFO("mouse-event BT? PRESS");
// not usefull to redraw
return true;
}
gtk_widget_queue_draw( widget );
return true;

View File

@ -9,11 +9,10 @@
* SQL
- sys : replace TAB with space when Tab is pressed
- sys : Catch F[1-12] ==> for user personal event
- sys : replace when TAB pressed and the selection did not select more than one Line
- BUG : Correction du bug des entré bizard tel que les chapot et les guillemets
- BUG : de sélection quand la ligne est pleine et la première ligne séctionnée.
- BUG : de copier coller sur les éàè ...
- BUG : sur le caplock et les caractère multiples type chapot ...
- BUG : les caractère multiples type chapot ...
- BUG : italique non généré
* 0.3.X :
- SEARCH : get selected text in the search windows