equal
deleted
inserted
replaced
495 if (caret_visible && text_area.isCaretVisible) { |
495 if (caret_visible && text_area.isCaretVisible) { |
496 val caret = text_area.getCaretPosition |
496 val caret = text_area.getCaretPosition |
497 if (start <= caret && caret == end - 1) { |
497 if (start <= caret && caret == end - 1) { |
498 val painter = text_area.getPainter |
498 val painter = text_area.getPainter |
499 val fm = painter.getFontMetrics |
499 val fm = painter.getFontMetrics |
|
500 val metric = JEdit_Lib.pretty_metric(painter) |
500 |
501 |
501 val offset = caret - text_area.getLineStartOffset(physical_line) |
502 val offset = caret - text_area.getLineStartOffset(physical_line) |
502 val x = text_area.offsetToXY(physical_line, offset).x |
503 val x = text_area.offsetToXY(physical_line, offset).x |
503 gfx.setColor(painter.getCaretColor) |
504 gfx.setColor(painter.getCaretColor) |
504 gfx.drawRect(x, y, Pretty.char_width(fm).round.toInt - 1, fm.getHeight - 1) |
505 gfx.drawRect(x, y, (metric.unit * metric.average).round.toInt - 1, fm.getHeight - 1) |
505 } |
506 } |
506 } |
507 } |
507 } |
508 } |
508 } |
509 } |
509 } |
510 } |