Changeset 20016 for trunk/FACT++/src
- Timestamp:
- 12/28/20 15:03:19 (4 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Readline.cc
r18833 r20016 139 139 rl_getc_function = rl_ncurses_getc; 140 140 rl_startup_hook = rl_ncurses_startup; 141 rl_redisplay_function = rl_ncurses_redisplay;141 // rl_redisplay_function = rl_ncurses_redisplay; 142 142 rl_event_hook = rl_ncurses_event_hook; 143 143 rl_completion_display_matches_hook = rl_ncurses_completion_display; … … 247 247 //! contents of the editing buffer. 248 248 // 249 /* 249 250 void Readline::rl_ncurses_redisplay() 250 251 { 251 252 This->Redisplay(); 252 253 } 254 */ 253 255 254 256 // -------------------------------------------------------------------------- … … 331 333 rl_on_new_line(); 332 334 333 if (rl_prompt==p && !newline) 334 return; 335 336 UpdatePrompt(p); 337 338 int w, h; 339 rl_get_screen_size(&h, &w); 340 cout << '\r' << string(w+1, ' ') << '\r'; 341 rl_forced_update_display(); 335 if (newline || rl_display_prompt!=p) 336 { 337 UpdatePrompt(p); 338 rl_forced_update_display(); 339 } 342 340 } 343 341 … … 359 357 //! Default: call rl_redisplay() 360 358 // 361 359 /* 362 360 void Readline::Redisplay() 363 361 { … … 379 377 rl_forced_update_display(); 380 378 } 379 */ 381 380 382 381 // -------------------------------------------------------------------------- … … 782 781 // -------------------------------------------------------------------------- 783 782 // 784 //! return strlen(rl_display_prompt) + rl_point 783 //! return rl_visible_prompt_length + rl_point 784 //! (the current position within the line) 785 785 // 786 786 int Readline::GetAbsCursor() 787 787 { 788 return strlen(rl_display_prompt) + rl_point; 788 extern int rl_visible_prompt_length; 789 return /*strlen(rl_display_prompt)*/rl_visible_prompt_length + rl_point; 789 790 } 790 791 … … 802 803 // -------------------------------------------------------------------------- 803 804 // 804 //! return the length of the prompt plus the length of the line buffer 805 //! return rl_visible_prompt_length + rl_end 806 //! (the length of the prompt plus the length of the line buffer) 805 807 // 806 808 int Readline::GetLineLength() 807 809 { 808 return strlen(rl_display_prompt) + rl_end; 810 extern int rl_visible_prompt_length; 811 return /*strlen(rl_display_prompt)*/rl_visible_prompt_length + rl_end; 809 812 } 810 813 -
trunk/FACT++/src/Readline.h
r16877 r20016 38 38 static int rl_ncurses_getc(FILE *); 39 39 static int rl_ncurses_startup(); 40 static void rl_ncurses_redisplay();40 //static void rl_ncurses_redisplay(); 41 41 static int rl_ncurses_event_hook(); 42 42 static void rl_ncurses_completion_display(char **matches, int num, int max); … … 53 53 virtual void EventHook(bool newline=false); 54 54 virtual void Shutdown(const char *buf); 55 virtual void Redisplay();55 //virtual void Redisplay(); 56 56 virtual void CompletionDisplay(char **matches, int num, int max); 57 57
Note:
See TracChangeset
for help on using the changeset viewer.