Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
fe9cf6f3
Commit
fe9cf6f3
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: make advancing and retreating more symmetrical
parent
21edf7bb
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils.c
+7
-6
src/utils.c
with
7 additions
and
6 deletions
+7
-6
src/utils.c
View file @
fe9cf6f3
...
...
@@ -611,20 +611,21 @@ size_t get_totsize(const filestruct *begin, const filestruct *end)
return
totsize
;
}
/* G
et back a pointer given a line number in
the c
u
rre
nt openfile
struct. */
/* G
iven a line number, return a pointer to
the c
o
rre
sponding
struct. */
filestruct
*
fsfromline
(
ssize_t
lineno
)
{
filestruct
*
f
=
openfile
->
current
;
if
(
lineno
<=
openfile
->
current
->
lineno
)
for
(;
f
->
lineno
!=
lineno
&&
f
!=
openfile
->
fileage
;
f
=
f
->
prev
)
;
while
(
f
->
lineno
!=
lineno
&&
f
->
prev
!=
NULL
)
f
=
f
->
prev
;
else
for
(;
f
->
lineno
!=
lineno
&&
f
->
next
!=
NULL
;
f
=
f
->
next
)
;
while
(
f
->
lineno
!=
lineno
&&
f
->
next
!=
NULL
)
f
=
f
->
next
;
if
(
f
->
lineno
!=
lineno
)
f
=
NULL
;
return
NULL
;
return
f
;
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help