aboutsummaryrefslogtreecommitdiffhomepage
path: root/highlight.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-06 14:34:53 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-06 14:34:53 -0700
commit345a52862587210477f8e5a9a41c21c26a265009 (patch)
tree9ac5160fdd6a08b429dc946be839445d2f87d26c /highlight.h
parent01d8490255764855fbf4d3e39995d061b3e69bfe (diff)
Untangle unescaping responsibilities in highlight.cpp. Fix cd autosuggestions to properly handle quotes. Factor out some of the quote unescaping behavior from reader.cpp to parse_util.cpp.
Add some autosuggestion tests
Diffstat (limited to 'highlight.h')
-rw-r--r--highlight.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/highlight.h b/highlight.h
index 339929cf..7e30fe08 100644
--- a/highlight.h
+++ b/highlight.h
@@ -114,7 +114,7 @@ rgb_color_t highlight_get_color( int highlight, bool is_background );
*/
bool autosuggest_validate_from_history(const history_item_t &item, file_detection_context_t &detector, const wcstring &working_directory, const env_vars &vars);
-/** Given the command line contents 'str', return via reference a suggestion by specially recognizing the command. Returns true if we recognized the command (even if we couldn't think of a suggestion for it).
+/** Given the command line contents 'str', return via reference a suggestion by specially recognizing the command. The suggestion is escaped. Returns true if we recognized the command (even if we couldn't think of a suggestion for it).
*/
bool autosuggest_suggest_special(const wcstring &str, const wcstring &working_directory, wcstring &outString);
@@ -122,7 +122,15 @@ bool autosuggest_suggest_special(const wcstring &str, const wcstring &working_di
This is used only internally to this file, and is exposed only for testing.
*/
-bool is_potential_path(const wcstring &const_path, const wcstring_list_t &directories, bool require_dir = false, wcstring *out_path = NULL);
+enum {
+ /* The path must be to a directory */
+ PATH_REQUIRE_DIR = 1 << 0,
+
+ /* Expand any leading tilde in the path */
+ PATH_EXPAND_TILDE = 1 << 1
+};
+typedef unsigned int path_flags_t;
+bool is_potential_path(const wcstring &const_path, const wcstring_list_t &directories, path_flags_t flags, wcstring *out_path = NULL);
#endif