diff options
| author | Eli Zaretskii | 2010-11-17 21:15:24 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2010-11-17 21:15:24 +0200 |
| commit | 146d267b8b8ef2c1823d54eb8a056bb6c443a22d (patch) | |
| tree | 3c0feb862315b9394c7cd460444af1d4ea5553f7 /src | |
| parent | fad0d5651923be042a38d89dfbd67c97dfd92a56 (diff) | |
| download | emacs-146d267b8b8ef2c1823d54eb8a056bb6c443a22d.tar.gz emacs-146d267b8b8ef2c1823d54eb8a056bb6c443a22d.zip | |
Fix bug #7417 with cursor positioning on empty lines.
xdisp.c (set_cursor_from_row): Fix cursor positioning in empty
lines on text-mode terminals.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 240155181c4..43a38c6a728 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-11-17 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix cursor positioning in empty | ||
| 4 | lines on text-mode terminals. (bug#7417) | ||
| 5 | |||
| 1 | 2010-11-17 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2010-11-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * xterm.c (get_current_wm_state): Rename from get_current_vm_state. | 8 | * xterm.c (get_current_wm_state): Rename from get_current_vm_state. |
diff --git a/src/xdisp.c b/src/xdisp.c index d3ebc1a4a8a..e02abf6a5b5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12839,6 +12839,15 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12839 | && BUFFERP (glyph->object) && glyph->charpos == pt_old) | 12839 | && BUFFERP (glyph->object) && glyph->charpos == pt_old) |
| 12840 | && bpos_covered < pt_old) | 12840 | && bpos_covered < pt_old) |
| 12841 | { | 12841 | { |
| 12842 | /* An empty line has a single glyph whose OBJECT is zero and | ||
| 12843 | whose CHARPOS is the position of a newline on that line. | ||
| 12844 | Note that on a TTY, there are more glyphs after that, which | ||
| 12845 | were produced by extend_face_to_end_of_line, but their | ||
| 12846 | CHARPOS is zero or negative. */ | ||
| 12847 | int empty_line_p = | ||
| 12848 | (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) | ||
| 12849 | && INTEGERP (glyph->object) && glyph->charpos > 0; | ||
| 12850 | |||
| 12842 | if (row->ends_in_ellipsis_p && pos_after == last_pos) | 12851 | if (row->ends_in_ellipsis_p && pos_after == last_pos) |
| 12843 | { | 12852 | { |
| 12844 | EMACS_INT ellipsis_pos; | 12853 | EMACS_INT ellipsis_pos; |
| @@ -12875,6 +12884,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12875 | || (row->truncated_on_right_p && pt_old > bpos_max) | 12884 | || (row->truncated_on_right_p && pt_old > bpos_max) |
| 12876 | /* Zero-width characters produce no glyphs. */ | 12885 | /* Zero-width characters produce no glyphs. */ |
| 12877 | || (!string_seen | 12886 | || (!string_seen |
| 12887 | && !empty_line_p | ||
| 12878 | && (row->reversed_p | 12888 | && (row->reversed_p |
| 12879 | ? glyph_after > glyphs_end | 12889 | ? glyph_after > glyphs_end |
| 12880 | : glyph_after < glyphs_end))) | 12890 | : glyph_after < glyphs_end))) |