From: <su...@us...> - 2008-11-26 08:57:46
|
Revision: 3085 http://tora.svn.sourceforge.net/tora/?rev=3085&view=rev Author: subik Date: 2008-11-26 08:57:43 +0000 (Wed, 26 Nov 2008) Log Message: ----------- fixed [tab] keyPressEvent when there are no "shortcuts" Modified Paths: -------------- trunk/tora/src/tohighlightedtext.cpp Modified: trunk/tora/src/tohighlightedtext.cpp =================================================================== --- trunk/tora/src/tohighlightedtext.cpp 2008-11-25 13:06:08 UTC (rev 3084) +++ trunk/tora/src/tohighlightedtext.cpp 2008-11-26 08:57:43 UTC (rev 3085) @@ -415,7 +415,8 @@ // handle editor shortcuts with TAB // It uses qscintilla lowlevel API to handle "word unde cursor" // This code is taken from sqliteman.com - if (toConfigurationSingle::Instance().useEditorShortcuts() && e->key() == Qt::Key_Tab) + if (toConfigurationSingle::Instance().useEditorShortcuts() + && e->key() == Qt::Key_Tab) { int pos = SendScintilla(SCI_GETCURRENTPOS); int start = SendScintilla(SCI_WORDSTARTPOSITION, pos,true); @@ -423,7 +424,6 @@ SendScintilla(SCI_SETSELECTIONSTART, start, true); SendScintilla(SCI_SETSELECTIONEND, end, true); QString key(selectedText()); - bool done = false; EditorShortcutsMap shorts(toConfigurationSingle::Instance().editorShortcuts()); if (shorts.contains(key)) { @@ -432,14 +432,13 @@ SendScintilla(SCI_SETCURRENTPOS, SendScintilla(SCI_GETCURRENTPOS) + shorts.value(key).toString().length()); - done = true; + pos = SendScintilla(SCI_GETCURRENTPOS); + SendScintilla(SCI_SETSELECTIONSTART, pos,true); + SendScintilla(SCI_SETSELECTIONEND, pos, true); + return; } - pos = SendScintilla(SCI_GETCURRENTPOS); SendScintilla(SCI_SETSELECTIONSTART, pos,true); SendScintilla(SCI_SETSELECTIONEND, pos, true); - - if (done) - return; } toMarkedText::keyPressEvent(e); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |