--- ./LYCurses.c-premark Wed Jan 17 19:55:18 2001 +++ ./LYCurses.c Thu Jan 18 20:37:38 2001 @@ -397,6 +397,7 @@ PUBLIC void curses_w_style ARGS3( case ABS_ON: /* change without remembering the previous style */ /* don't cache style changes for active links and edits */ if ( style != s_alink && style != s_curedit && style != s_aedit + && style != s_aedit_sel && style != s_aedit_pad && style != s_aedit_arr ) { CTRACE((tfp, "CACHED: <%s> @(%d,%d)\n", ds->name, YP, XP)); if (win == stdscr) cached_styles[YP][XP] = style; --- ./LYHash.h-premark Wed Jan 17 19:53:08 2001 +++ ./LYHash.h Thu Jan 18 20:41:58 2001 @@ -43,7 +43,8 @@ extern int s_alink, s_a, s_status, s_sb_bar, s_sb_bg, s_sb_aa, s_sb_naa, #endif s_whereis, s_curedit, s_aedit, s_aedit_pad, s_aedit_arr, - s_prompt_edit, s_prompt_edit_pad, s_prompt_edit_arr; + s_prompt_edit, s_prompt_edit_pad, s_prompt_edit_arr, + s_aedit_sel, s_prompt_sel; #define CACHEW 128 #define CACHEH 64 --- ./LYStyle.c-premark Wed Jan 17 19:54:54 2001 +++ ./LYStyle.c Thu Jan 18 21:23:02 2001 @@ -71,6 +71,7 @@ PUBLIC int s_alink = NOSTYLE, s_a = s_sb_aa = NOSTYLE, s_sb_naa = NOSTYLE, #endif s_whereis = NOSTYLE, s_curedit = NOSTYLE, s_aedit = NOSTYLE, + s_aedit_sel = NOSTYLE, s_prompt_sel = NOSTYLE, s_aedit_pad = NOSTYLE, s_aedit_arr = NOSTYLE, s_prompt_edit = NOSTYLE, s_prompt_edit_pad = NOSTYLE, s_prompt_edit_arr = NOSTYLE; @@ -302,12 +303,17 @@ where OBJECT is one of EM,STRONG,B,I,U,B parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.active.arrow"); s_aedit_arr = hash_code("edit.active.arrow"); } + else if (!strncasecomp(element, "edit.active.marked", 18)) + { + parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.active.marked"); + s_aedit_sel = hash_code("edit.active.marked"); + } else if (!strncasecomp(element, "edit.active", 11)) { parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.active"); s_aedit = hash_code("edit.active"); } - else if (!strncasecomp(element, "edit.current", 11)) + else if (!strncasecomp(element, "edit.current", 12)) { parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.current"); s_curedit = hash_code("edit.current"); @@ -322,6 +328,11 @@ where OBJECT is one of EM,STRONG,B,I,U,B parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.prompt.arrow"); s_prompt_edit_arr = hash_code("edit.prompt.arrow"); } + else if (!strncasecomp(element, "edit.prompt.marked", 18)) + { + parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.prompt.marked"); + s_prompt_sel = hash_code("edit.prompt.marked"); + } else if (!strncasecomp(element, "edit.prompt", 11)) { parse_attributes(mono,fg,bg,DSTYLE_ELEMENTS,"edit.prompt"); @@ -453,6 +464,8 @@ PUBLIC void parse_userstyles NOARGS s_prompt_edit_arr = s_prompt_edit; if (s_prompt_edit_pad == NOSTYLE) s_prompt_edit_pad = s_prompt_edit; + if (s_prompt_sel == NOSTYLE) + s_prompt_sel = s_prompt_edit; if (s_aedit == NOSTYLE) s_aedit = s_alink; if (s_aedit_arr == NOSTYLE) @@ -461,6 +474,8 @@ PUBLIC void parse_userstyles NOARGS s_aedit_pad = s_aedit; if (s_curedit == NOSTYLE) s_curedit = s_aedit; + if (s_aedit_sel == NOSTYLE) + s_aedit_sel = s_aedit; } --- ./LYStrings.c-bad1 Thu Jan 18 19:59:24 2001 +++ ./LYStrings.c Thu Jan 18 21:14:06 2001 @@ -3317,7 +3304,19 @@ PUBLIC void LYRefreshEdit ARGS1( for (i = 0; i < nrdisplayed; i++) addch('*'); } else { - for (i = 0; i < nrdisplayed; i++) +#ifdef ENHANCED_LINEEDIT + if (DspStart > Mark) + TmpStyleOn(prompting ? s_prompt_sel : s_aedit_sel); +#endif + for (i = 0; i < nrdisplayed; i++) { +#ifdef ENHANCED_LINEEDIT + if ( (DspStart + i == Mark && Pos > Mark) + || (DspStart + i == Pos && Pos < Mark) ) + TmpStyleOn(prompting ? s_prompt_sel : s_aedit_sel); + if ( (DspStart + i == Mark && Pos < Mark) + || (DspStart + i == Pos && Pos > Mark) ) + TmpStyleOff(prompting ? s_prompt_sel : s_aedit_sel); +#endif if ((buffer[0] = str[i]) == 1 || buffer[0] == 2 || ((unsigned char)buffer[0] == 160 && !(HTPassHighCtrlRaw || HTCJK != NOCJK || @@ -3350,6 +3349,12 @@ PUBLIC void LYRefreshEdit ARGS1( #endif /* SUPPORT_MULTIBYTE_EDIT */ } } + } +#ifdef ENHANCED_LINEEDIT + if ((DspStart + nrdisplayed <= Mark && DspStart + nrdisplayed > Pos) + || (DspStart + nrdisplayed > Mark && DspStart + nrdisplayed <= Pos)) + TmpStyleOff(prompting ? s_prompt_sel : s_aedit_sel); +#endif } /*