all repos — fluxbox @ 4e360624e639a77a37818fd9b696a6c58aff0b54

custom fork of the fluxbox windowmanager

minor fix
fluxgen fluxgen
commit

4e360624e639a77a37818fd9b696a6c58aff0b54

parent

5c047ad1c3983aee5fd2513016189bd9ab63c857

1 files changed, 10 insertions(+), 11 deletions(-)

jump to
M util/fbrun/FbRun.ccutil/fbrun/FbRun.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbRun.cc,v 1.26 2004/04/18 14:16:09 fluxgen Exp $ +// $Id: FbRun.cc,v 1.27 2004/04/18 18:57:24 fluxgen Exp $ #include "FbRun.hh"

@@ -135,7 +135,6 @@ }

sort(m_apps.begin(), m_apps.end()); unique(m_apps.begin(), m_apps.end()); - reverse(m_apps.begin(), m_apps.end()); if (!m_apps.empty()) m_current_apps_item= 1;

@@ -385,20 +384,20 @@ void FbRun::tabCompleteApps() {

if ( m_current_apps_item == 0 || m_apps.empty() ) { XBell(m_display, 0); } else { - unsigned int nr= 0; - int apps_item = m_current_apps_item - 1; + size_t apps_item = m_current_apps_item + 1; string prefix = text().substr(0, cursorPosition()); - while (apps_item != m_current_apps_item && nr++ < m_apps.size()) { - if (apps_item <= -1 ) - apps_item= m_apps.size() - 1; - if (m_apps[apps_item].find(prefix) == 0) { + while (apps_item != m_current_apps_item) { + if (apps_item > m_apps.size() ) + apps_item = 1; + if (m_apps[apps_item - 1].find(prefix) == 0) { m_current_apps_item = apps_item; - setText(m_apps[m_current_apps_item]); + setText(m_apps[m_current_apps_item - 1]); break; } - apps_item--; + apps_item++; } - if (apps_item == m_current_apps_item) XBell(m_display, 0); + if (apps_item == m_current_apps_item) + XBell(m_display, 0); } }