diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-07-22 22:30:25 (GMT) |
---|---|---|
committer | Thomas Lübking <thomas.luebking@gmail.com> | 2016-07-23 14:58:04 (GMT) |
commit | d741b6fe6e805b570bb899e777ea7101f6395721 (patch) | |
tree | 97a1d8f2b8098da18263ee62cd5362701ee926ff /util/fbrun/FbRun.hh | |
parent | ed75e883db8426e889a46ce61b9f4bd1a4d6bc66 (diff) | |
download | fluxbox-d741b6fe6e805b570bb899e777ea7101f6395721.zip fluxbox-d741b6fe6e805b570bb899e777ea7101f6395721.tar.bz2 |
improve fbrun completion
- streamline code
- indicate completion by making use of selection
- fix buggy behavior (notably subsequent completions and FS path
following)
- support "~" in paths
- support chunk completion
(ie. "mp[layer] ~/vid[eos/favporn.mp4]" can be completed in both
tokens; buggy with paths including spaces in non-leafs)
REQUEST: 223
Diffstat (limited to 'util/fbrun/FbRun.hh')
-rw-r--r-- | util/fbrun/FbRun.hh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/util/fbrun/FbRun.hh b/util/fbrun/FbRun.hh index 5d678b0..a74d347 100644 --- a/util/fbrun/FbRun.hh +++ b/util/fbrun/FbRun.hh | |||
@@ -80,7 +80,7 @@ private: | |||
80 | void adjustEndPos(); | 80 | void adjustEndPos(); |
81 | void firstHistoryItem(); | 81 | void firstHistoryItem(); |
82 | void lastHistoryItem(); | 82 | void lastHistoryItem(); |
83 | void tabCompleteHistory(); | 83 | void tabComplete(const std::vector<std::string> &list, int ¤t, bool reverse = false); |
84 | void tabCompleteApps(); | 84 | void tabCompleteApps(); |
85 | 85 | ||
86 | bool m_print; ///< the input should be printed to stdout rather than run | 86 | bool m_print; ///< the input should be printed to stdout rather than run |
@@ -89,16 +89,20 @@ private: | |||
89 | int m_bevel; | 89 | int m_bevel; |
90 | FbTk::GContext m_gc; ///< graphic context | 90 | FbTk::GContext m_gc; ///< graphic context |
91 | bool m_end; ///< marks when this object is done | 91 | bool m_end; ///< marks when this object is done |
92 | |||
92 | std::vector<std::string> m_history; ///< history list of commands | 93 | std::vector<std::string> m_history; ///< history list of commands |
93 | std::string m_history_file; ///< holds filename for command history file | 94 | std::string m_history_file; ///< holds filename for command history file |
94 | size_t m_current_history_item; ///< holds current position in command history | 95 | int m_current_history_item; ///< holds current position in command history |
95 | std::string m_last_completion_prefix; ///< last prefix we completed on | 96 | |
96 | 97 | std::vector<std::string> m_files; | |
97 | typedef std::vector<std::string> AppsContainer; | 98 | int m_current_files_item; |
98 | typedef AppsContainer::iterator AppsContainerIt; | 99 | std::string m_last_completion_path; ///< last prefix we completed on |
99 | AppsContainer m_apps; ///< holds all apps in $PATH | 100 | |
100 | size_t m_current_apps_item; ///< holds current position in apps-history | 101 | std::vector<std::string> m_apps; |
101 | 102 | int m_current_apps_item; ///< holds current position in apps-history | |
103 | |||
104 | size_t m_completion_pos; | ||
105 | |||
102 | Cursor m_cursor; | 106 | Cursor m_cursor; |
103 | 107 | ||
104 | FbTk::FbPixmap m_pixmap; | 108 | FbTk::FbPixmap m_pixmap; |