aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2004-08-02 23:42:14 +0000
committerKim F. Storm <[email protected]>2004-08-02 23:42:14 +0000
commited5c373cab5483317a8b6fca3d8d4d52432934fc (patch)
tree986ab9435940890e56741ff9b1107ca65ce7e45d /src
parentfb8b092b99720c028ecbf48bc9a423024786af86 (diff)
(compute_motion): Fix check for full width window
in non-window case. Do not count left truncation glyph on window systems.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c
index 6cb82c18f0..63f1ed3193 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1231,6 +1231,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
int prev_vpos = 0;
int contin_hpos; /* HPOS of last column of continued line. */
int prev_tab_offset; /* Previous tab offset. */
+ int continuation_glyph_width;
XSETBUFFER (buffer, current_buffer);
XSETWINDOW (window, win);
@@ -1259,6 +1260,12 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
width -= 1;
}
+ continuation_glyph_width = 0;
+#ifdef HAVE_WINDOW_SYSTEM
+ if (!FRAME_WINDOW_P (XFRAME (win->frame)))
+ continuation_glyph_width = 1;
+#endif
+
immediate_quit = 1;
QUIT;
@@ -1382,7 +1389,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
{
if (hscroll
|| (truncate_partial_width_windows
- && width < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))
+ && ((width + continuation_glyph_width)
+ < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))))
|| !NILP (current_buffer->truncate_lines))
{
/* Truncating: skip to newline, unless we are already past
@@ -1666,7 +1674,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
hpos -= hscroll;
/* Count the truncation glyph on column 0 */
if (hscroll > 0)
- hpos++;
+ hpos += continuation_glyph_width;
tab_offset = 0;
}
contin_hpos = 0;