On 3/5/14 3:41 AM, solr...@gmail.com wrote: > On Monday, March 3, 2014 3:06:57 PM UTC+1, Chet Ramey wrote: >> I have not done any work in this area, and have no immediate plans to. The >> >> readline internals do not lend themselves to this very well: the line >> >> buffer management and display engines assume that every character in the >> >> line buffer contributes to the screen display and should be displayed. You >> >> would need an auxiliary data structure to save and manipulate this >> >> information. > > Okay, thanks. Do you have any hints on where to start if I want to implement > this?
Sure. Think about it from a top-down perspective. You need commands to allow users to add and remove `colored regions'. You need a way to represent those regions, or a way to indicate which parts of rl_line_buffer should be highlighted. You need a way to translate those regions into a representation of a line that should be displayed. Then you need a way to tell the redisplay engine in display.c that it should not try and display the characters but instead write them directly to the terminal and that they do not take up real estate on the screen. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/