From: Jay Freeman (saurik) Date: Thu, 13 Sep 2012 06:55:49 +0000 (-0700) Subject: Use ?syntax by default and have it control input. X-Git-Tag: v0.9.459~10 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/cd98d28056cd736c9493d73efd0c00861e6b3490 Use ?syntax by default and have it control input. --- diff --git a/Console.cpp b/Console.cpp index 14a6590..642cc20 100644 --- a/Console.cpp +++ b/Console.cpp @@ -399,19 +399,13 @@ static void Console(CYOptions &options) { rl_initialize(); rl_readline_name = name_; -#if RL_READLINE_VERSION >= 0x0600 - rl_prep_term_function = CYDisplayStart; - rl_redisplay_function = CYDisplayUpdate; - rl_deprep_term_function = CYDisplayFinish; -#endif - mkdir(basedir, 0700); read_history(histfile); bool bypass(false); bool debug(false); bool expand(false); - bool syntax(false); + bool syntax(true); out_ = &std::cout; @@ -442,9 +436,23 @@ static void Console(CYOptions &options) { } read: + +#if RL_READLINE_VERSION >= 0x0600 + if (syntax) { + rl_prep_term_function = CYDisplayStart; + rl_redisplay_function = CYDisplayUpdate; + rl_deprep_term_function = CYDisplayFinish; + } else { + rl_prep_term_function = rl_prep_terminal; + rl_redisplay_function = rl_redisplay; + rl_deprep_term_function = rl_deprep_terminal; + } +#endif + mode_ = Parsing; char *line(readline(prompt)); mode_ = Working; + if (line == NULL) break; if (line[0] == '\0')