Changeset 16869
- Timestamp:
- 06/19/13 17:09:29 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Console.cc
r14083 r16869 149 149 //! EventHook to update the prompt. 150 150 // 151 void Console::EventHook( )151 void Console::EventHook(bool) 152 152 { 153 153 // If the output is continous and we are going to output something … … 155 155 // doesn't work well if the input line is already two lines) 156 156 // and then flush the buffer. 157 if (fContinous && fLogO.GetSizeBacklog()>0) 157 const bool newline = fContinous && fLogO.GetSizeBacklog()>0; 158 if (newline) 158 159 { 159 160 // Clear the line we are going to overwrite … … 163 164 164 165 // Call Readline's EventHook to update the prompt 165 Readline::EventHook( );166 Readline::EventHook(newline); 166 167 } 167 168 -
trunk/FACT++/src/Console.h
r14083 r16869 69 69 70 70 void Startup(); 71 void EventHook( );71 void EventHook(bool); 72 72 void Run(const char * = 0); 73 73 }; -
trunk/FACT++/src/Readline.cc
r16868 r16869 310 310 //! with some information (e.g. time) just by overwriting GetUpdatePrompt() 311 311 //! 312 void Readline::EventHook( )312 void Readline::EventHook(bool newline) 313 313 { 314 314 const string cpy = fExternalInput; … … 325 325 p = rl_prompt; 326 326 327 const string line_buffer = rl_line_buffer; 328 const int point = rl_point; 329 330 rl_replace_line("", 1); 331 UpdatePrompt(""); 332 Redisplay(); 333 334 rl_replace_line(line_buffer.c_str(), 1); 335 rl_point = point; 327 if (newline) 328 rl_on_new_line(); 336 329 337 330 UpdatePrompt(p); -
trunk/FACT++/src/Readline.h
r15104 r16869 6 6 #include <vector> 7 7 #include <fstream> 8 #include <iostream> 8 9 9 10 class Readline … … 50 51 virtual int Getc(FILE *); 51 52 virtual void Startup(); 52 virtual void EventHook( );53 virtual void EventHook(bool newline=false); 53 54 virtual void Shutdown(const char *buf); 54 55 virtual void Redisplay(); … … 99 100 virtual bool PreProcess(const std::string &str); 100 101 virtual bool Process(const std::string &str); 101 virtual std::string GetUpdatePrompt() const { return ""; }102 virtual std::string GetUpdatePrompt() const { std::cout << "**********" << std::endl; return ""; } 102 103 virtual bool PromptEOF(std::string &str); 103 104 virtual std::string Prompt(const std::string &prompt); -
trunk/FACT++/src/ReadlineWindow.h
r10183 r16869 20 20 void Startup(); 21 21 void Redisplay(); 22 void EventHook( );22 void EventHook(bool = false); 23 23 void CompletionDisplay(char **matches, int num, int max); 24 24
Note:
See TracChangeset
for help on using the changeset viewer.