diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-08-06 16:24:34 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-08-06 16:24:34 +0300 |
commit | 55c25e73d46685e4b4423b13b0d3287fee170386 (patch) | |
tree | 2927e3f370a25ea5f21e587ba473de63a269a761 /src/indent.c | |
parent | d8abff398bc45a791783c5c463838ba6fa3f030e (diff) | |
download | emacs-55c25e73d46685e4b4423b13b0d3287fee170386.tar.gz emacs-55c25e73d46685e4b4423b13b0d3287fee170386.tar.bz2 emacs-55c25e73d46685e4b4423b13b0d3287fee170386.zip |
Fix C-n/C-p inside bidirectional text
* src/xdisp.c (move_it_by_lines, try_cursor_movement): Handle
glyph rows whose direction of increasing buffer positions is
reverse of the normal: going down in the window makes buffer
positions higher.
* src/indent.c (Fvertical_motion): When looking for the last glyph
row occupied by point, take into account the bidi iteration
direction.
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c index fd2e7636656..d2dfaee254e 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2345,7 +2345,15 @@ whether or not it is currently displayed in some window. */) last line that it occupies. */ if (it_start < ZV) { - while (IT_CHARPOS (it) <= it_start) + if ((it.bidi_it.scan_dir > 0) + ? IT_CHARPOS (it) < it_start + : IT_CHARPOS (it) > it_start) + { + it.vpos = 0; + it.current_y = 0; + move_it_by_lines (&it, 1); + } + while (IT_CHARPOS (it) == it_start) { it.vpos = 0; it.current_y = 0; |