diff options
| author | Kim F. Storm | 2005-01-27 00:16:28 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-01-27 00:16:28 +0000 |
| commit | 999f5a607e17b7565b90ff4161bebc113f65ada9 (patch) | |
| tree | 66b63c87df8c99e010bd9dc1bdcec32e7456244a /src | |
| parent | 889f36418f495a3a45c484730a1f3aa592cc08ff (diff) | |
| download | emacs-999f5a607e17b7565b90ff4161bebc113f65ada9.tar.gz emacs-999f5a607e17b7565b90ff4161bebc113f65ada9.zip | |
(get_glyph_string_clip_rect): Always show a cursor
glyph, even when row is only partially visible and actual cursor
position is not visible.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index d7c32be09ea..e83004d1741 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1837,7 +1837,7 @@ get_glyph_string_clip_rect (s, nr) | |||
| 1837 | if (s->hl == DRAW_CURSOR) | 1837 | if (s->hl == DRAW_CURSOR) |
| 1838 | { | 1838 | { |
| 1839 | struct glyph *glyph = s->first_glyph; | 1839 | struct glyph *glyph = s->first_glyph; |
| 1840 | int height; | 1840 | int height, max_y; |
| 1841 | 1841 | ||
| 1842 | if (s->x > r.x) | 1842 | if (s->x > r.x) |
| 1843 | { | 1843 | { |
| @@ -1846,13 +1846,26 @@ get_glyph_string_clip_rect (s, nr) | |||
| 1846 | } | 1846 | } |
| 1847 | r.width = min (r.width, glyph->pixel_width); | 1847 | r.width = min (r.width, glyph->pixel_width); |
| 1848 | 1848 | ||
| 1849 | /* Don't draw cursor glyph taller than our actual glyph. */ | 1849 | /* If r.y is below window bottom, ensure that we still see a cursor. */ |
| 1850 | height = max (FRAME_LINE_HEIGHT (s->f), glyph->ascent + glyph->descent); | 1850 | height = min (glyph->ascent + glyph->descent, |
| 1851 | if (height < r.height) | 1851 | min (FRAME_LINE_HEIGHT (s->f), s->row->visible_height)); |
| 1852 | max_y = window_text_bottom_y (s->w) - height; | ||
| 1853 | max_y = WINDOW_TO_FRAME_PIXEL_Y (s->w, max_y); | ||
| 1854 | if (s->ybase - glyph->ascent > max_y) | ||
| 1852 | { | 1855 | { |
| 1853 | int max_y = r.y + r.height; | 1856 | r.y = max_y; |
| 1854 | r.y = min (max_y, s->ybase + glyph->descent - height); | 1857 | r.height = height; |
| 1855 | r.height = min (max_y - r.y, height); | 1858 | } |
| 1859 | else | ||
| 1860 | { | ||
| 1861 | /* Don't draw cursor glyph taller than our actual glyph. */ | ||
| 1862 | height = max (FRAME_LINE_HEIGHT (s->f), glyph->ascent + glyph->descent); | ||
| 1863 | if (height < r.height) | ||
| 1864 | { | ||
| 1865 | max_y = r.y + r.height; | ||
| 1866 | r.y = min (max_y, max (r.y, s->ybase + glyph->descent - height)); | ||
| 1867 | r.height = min (max_y - r.y, height); | ||
| 1868 | } | ||
| 1856 | } | 1869 | } |
| 1857 | } | 1870 | } |
| 1858 | 1871 | ||