aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-02-25 18:37:47 (GMT)
committerfluxgen <fluxgen>2004-02-25 18:37:47 (GMT)
commit25957274a47255245e54b5ab19ae6693bffaef79 (patch)
tree9e12fb02e89781361a229e68e162386d4331d94d
parent08f170c3ef9b305f0b0954e7a21265790f246c1d (diff)
downloadfluxbox-25957274a47255245e54b5ab19ae6693bffaef79.zip
fluxbox-25957274a47255245e54b5ab19ae6693bffaef79.tar.bz2
cycle tabcompletion, patch from Mathias Gumz
-rw-r--r--util/fbrun/FbRun.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc
index 27270d5..47e35bf 100644
--- a/util/fbrun/FbRun.cc
+++ b/util/fbrun/FbRun.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbRun.cc,v 1.23 2003/12/31 01:34:33 fluxgen Exp $ 22// $Id: FbRun.cc,v 1.24 2004/02/25 18:37:47 fluxgen Exp $
23 23
24#include "FbRun.hh" 24#include "FbRun.hh"
25 25
@@ -208,6 +208,7 @@ void FbRun::keyPressEvent(XKeyEvent &ke) {
208 // strip numlock, capslock and scrolllock mask 208 // strip numlock, capslock and scrolllock mask
209 ke.state = FbTk::KeyUtil::instance().cleanMods(ke.state); 209 ke.state = FbTk::KeyUtil::instance().cleanMods(ke.state);
210 210
211 int cp= cursorPosition();
211 FbTk::TextBox::keyPressEvent(ke); 212 FbTk::TextBox::keyPressEvent(ke);
212 KeySym ks; 213 KeySym ks;
213 char keychar[1]; 214 char keychar[1];
@@ -253,6 +254,7 @@ void FbRun::keyPressEvent(XKeyEvent &ke) {
253 break; 254 break;
254 case XK_Tab: 255 case XK_Tab:
255 tabCompleteHistory(); 256 tabCompleteHistory();
257 setCursorPosition(cp);
256 break; 258 break;
257 } 259 }
258 } 260 }
@@ -317,7 +319,9 @@ void FbRun::tabCompleteHistory() {
317 } else { 319 } else {
318 int history_item = m_current_history_item - 1; 320 int history_item = m_current_history_item - 1;
319 string prefix = text().substr(0, cursorPosition()); 321 string prefix = text().substr(0, cursorPosition());
320 while (history_item > - 1) { 322 while (history_item != m_current_history_item ) {
323 if (history_item == -1 )
324 history_item+= m_history.size();
321 if (m_history[history_item].find(prefix) == 0) { 325 if (m_history[history_item].find(prefix) == 0) {
322 m_current_history_item = history_item; 326 m_current_history_item = history_item;
323 setText(m_history[m_current_history_item]); 327 setText(m_history[m_current_history_item]);
@@ -325,7 +329,7 @@ void FbRun::tabCompleteHistory() {
325 } 329 }
326 history_item--; 330 history_item--;
327 } 331 }
328 if (history_item == -1) XBell(m_display, 0); 332 if (history_item == m_current_history_item) XBell(m_display, 0);
329 } 333 }
330} 334}
331 335