From 318d76b47c76e5473c8f95dcb011e8e1f34d6e8e Mon Sep 17 00:00:00 2001 From: mathias Date: Mon, 9 May 2005 07:20:17 +0000 Subject: fix from vadim for fbrun-tabcompletion --- ChangeLog | 2 ++ src/FbTk/TextBox.hh | 1 + util/fbrun/FbRun.cc | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a70c2f..b42ffbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.13 *05/05/09: + * Fix for fbrun and completion (thanx Vadim) + TextBox.hh fbrun.cc * Fix for gentoo-bug #91955 (thanx Julien Trolet) Remembering the position of a window didnt store the reference corner diff --git a/src/FbTk/TextBox.hh b/src/FbTk/TextBox.hh index 6b68f28..02b8f59 100644 --- a/src/FbTk/TextBox.hh +++ b/src/FbTk/TextBox.hh @@ -68,6 +68,7 @@ public: const Font &font() const { return *m_font; } GC gc() const { return m_gc; } int cursorPosition() const { return m_cursor_pos; } + inline int textStartPos(){ return m_start_pos; } int findEmptySpaceLeft(); int findEmptySpaceRight(); diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index d72d1bf..fcdf682 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -343,7 +343,7 @@ void FbRun::tabCompleteHistory() { } else { unsigned int nr= 0; int history_item = m_current_history_item - 1; - string prefix = text().substr(0, cursorPosition()); + string prefix = text().substr(0, textStartPos() + cursorPosition()); while (history_item != m_current_history_item && nr++ < m_history.size()) { if (history_item <= -1 ) history_item= m_history.size() - 1; @@ -362,7 +362,7 @@ void FbRun::tabCompleteApps() { static bool first_run= true; static string saved_prefix= ""; - string prefix= text().substr(0, cursorPosition()); + string prefix= text().substr(0, textStartPos() + cursorPosition()); FbTk::Directory dir; bool add_dirs= false; -- cgit v0.11.2