Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
8964fd83
Commit
8964fd83
authored
Mar 10, 2005
by
Kim F. Storm
Browse files
(pos_visible_p): Fix X value in last line of buffer.
parent
b0a6f45c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
src/xdisp.c
src/xdisp.c
+11
-19
No files found.
src/xdisp.c
View file @
8964fd83
...
...
@@ -1298,6 +1298,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
/* Note that we may overshoot because of invisible text. */
if (IT_CHARPOS (it) >= charpos)
{
int top_x = it.current_x;
int top_y = it.current_y;
int bottom_y = (last_height = 0, line_bottom_y (&it));
int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w);
...
...
@@ -1306,15 +1307,12 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
visible_p = bottom_y > window_top_y;
else if (top_y < it.last_visible_y)
visible_p = 1;
if (visible_p
&& x
)
if (visible_p)
{
*x =
it.current
_x;
*x =
top
_x;
*y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y);
if (rtop)
{
*rtop = max (0, window_top_y - top_y);
*rbot = max (0, bottom_y - it.last_visible_y);
}
*rtop = max (0, window_top_y - top_y);
*rbot = max (0, bottom_y - it.last_visible_y);
}
}
else
...
...
@@ -1327,18 +1325,12 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
if (charpos < IT_CHARPOS (it))
{
visible_p = 1;
if (x)
{
move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
*x = it2.current_x;
*y = it2.current_y + it2.max_ascent - it2.ascent;
if (rtop)
{
*rtop = max (0, -it2.current_y);
*rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent)
- it.last_visible_y));
}
}
move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS);
*x = it2.current_x;
*y = it2.current_y + it2.max_ascent - it2.ascent;
*rtop = max (0, -it2.current_y);
*rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent)
- it.last_visible_y));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment