Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
77b68646
Commit
77b68646
authored
Nov 01, 1994
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fast_find_position): Special case if POS is end of buffer.
parent
163638a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
src/xterm.c
src/xterm.c
+17
-0
No files found.
src/xterm.c
View file @
77b68646
...
...
@@ -2018,6 +2018,7 @@ fast_find_position (window, pos, columnp, rowp)
int
width
=
window_internal_width
(
w
);
int
*
charstarts
;
int
lastcol
;
int
maybe_next_line
=
0
;
/* Find the right row. */
for
(
i
=
0
;
...
...
@@ -2027,6 +2028,13 @@ fast_find_position (window, pos, columnp, rowp)
int
linestart
=
FRAME_CURRENT_GLYPHS
(
f
)
->
charstarts
[
top
+
i
][
left
];
if
(
linestart
>
pos
)
break
;
/* If the position sought is the end of the buffer,
don't include the blank lines at the bottom of the window. */
if
(
linestart
==
pos
&&
pos
==
BUF_ZV
(
XBUFFER
(
w
->
buffer
)))
{
maybe_next_line
=
1
;
break
;
}
if
(
linestart
>
0
)
row
=
i
;
}
...
...
@@ -2048,6 +2056,15 @@ fast_find_position (window, pos, columnp, rowp)
lastcol
=
left
+
i
;
}
/* If we're looking for the end of the buffer,
and we didn't find it in the line we scanned,
use the start of the following line. */
if
(
maybe_next_line
)
{
row
++
;
i
=
0
;
}
*
rowp
=
row
+
top
;
*
columnp
=
lastcol
;
return
0
;
...
...
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