Unified · Split
| @@ -54,6 +54,7 @@ enum { · 53 unmodified lines | ||
| 54 | 54 | Numcolors, |
| 55 | 55 | |
| 56 | 56 | /* this might become a bad idea in the future */ |
| 57 | + Mark_flag_group_highlight = 1<<6, | |
| 57 | 58 | Mark_flag_selected = 1<<7, |
| 58 | 59 | }; |
| 59 | 60 | |
| @@ -316,9 +317,9 @@ redraw(int complete) · 256 unmodified lines | ||
| 316 | 317 | Point p, top, bot; |
| 317 | 318 | int x, y, rx, ry, i; |
| 318 | 319 | int oldbg, oldfg, bg, fg, attr, off; |
| 319 | − bool selected; | |
| 320 | + bool selected, grouphl; | |
| 320 | 321 | char s[32]; |
| 321 | − Rune c; | |
| 322 | + Rune c, csel; | |
| 322 | 323 | |
| 323 | 324 | p = addpt(screen->r.min, Pt(Txtoff, Txtoff)); |
| 324 | 325 | top = p; |
| @@ -337,6 +338,11 @@ redraw(int complete) · 12 unmodified lines | ||
| 337 | 338 | draw(screen, r, color[Dback], nil, ZP); |
| 338 | 339 | } |
| 339 | 340 | |
| 341 | + off = field.width*cury + curx; | |
| 342 | + csel = field.buffer[off]; | |
| 343 | + if (csel == '.' || (mbuf.buffer[off] & (Mark_flag_input|Mark_flag_output)) != 0) | |
| 344 | + csel = 0; | |
| 345 | + | |
| 340 | 346 | bg = -1; |
| 341 | 347 | fg = -1; |
| 342 | 348 | for (y = 0; y < field.height && p.y < bot.y-charh; y++) { |
| @@ -354,7 +360,14 @@ redraw(int complete) · 11 unmodified lines | ||
| 354 | 360 | else |
| 355 | 361 | attr &= ~Mark_flag_selected; |
| 356 | 362 | |
| 357 | − if (!complete && c == copyfield.buffer[off] && attr == mscr.buffer[off]) { | |
| 363 | + /* highlight the same char */ | |
| 364 | + grouphl = c != '.' && csel == c && (x != curx || y != cury); | |
| 365 | + if (grouphl) | |
| 366 | + attr |= Mark_flag_group_highlight; | |
| 367 | + else | |
| 368 | + attr &= ~Mark_flag_group_highlight; | |
| 369 | + | |
| 370 | + if (!grouphl && !complete && c == copyfield.buffer[off] && attr == mscr.buffer[off]) { | |
| 358 | 371 | if (i > 0) { |
| 359 | 372 | p = runestringnbg(screen, p, color[oldfg], ZP, font, linebuf, i, color[oldbg], ZP); |
| 360 | 373 | i = 0; |
| @@ -367,7 +380,7 @@ redraw(int complete) · 6 unmodified lines | ||
| 367 | 380 | mscr.buffer[off] = attr; |
| 368 | 381 | |
| 369 | 382 | bg = selected ? Dbinv : Dback; |
| 370 | − fg = selected ? Dfinv : Dfmed; | |
| 383 | + fg = selected ? Dfinv : (grouphl ? Dbinv: Dfmed); | |
| 371 | 384 | |
| 372 | 385 | if (c == '.') |
| 373 | 386 | c = dot[dotstyle]; |
| @@ -379,7 +392,7 @@ redraw(int complete) · 5 unmodified lines | ||
| 379 | 392 | c = rulerstyle == Snone ? dot[dotstyle] : ruler[rulerstyle][ry*3+rx]; |
| 380 | 393 | } |
| 381 | 394 | fg = Dflow; |
| 382 | − } else if (!selected) { | |
| 395 | + } else if (!selected && !grouphl) { | |
| 383 | 396 | if (c == '#') { |
| 384 | 397 | fg = Dfmed; |
| 385 | 398 | } else { |