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
09723b07
Commit
09723b07
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: fix compilation with --enable-tiny
parent
dd667ce9
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/proto.h
+1
-1
src/proto.h
src/winio.c
+26
-28
src/winio.c
with
27 additions
and
29 deletions
+27
-29
src/proto.h
View file @
09723b07
...
...
@@ -665,13 +665,13 @@ void edit_scroll(scroll_dir direction, int nrows);
#ifndef NANO_TINY
size_t
get_softwrap_breakpoint
(
const
char
*
text
,
size_t
leftedge
,
bool
*
end_of_line
);
size_t
actual_last_column
(
size_t
leftedge
,
size_t
column
);
size_t
get_chunk
(
filestruct
*
line
,
size_t
column
,
size_t
*
leftedge
);
size_t
get_chunk_row
(
filestruct
*
line
,
size_t
column
);
size_t
get_chunk_leftedge
(
filestruct
*
line
,
size_t
column
);
size_t
get_last_chunk_row
(
filestruct
*
line
);
void
ensure_firstcolumn_is_aligned
(
void
);
#endif
size_t
actual_last_column
(
size_t
leftedge
,
size_t
column
);
void
edit_redraw
(
filestruct
*
old_current
);
void
edit_refresh
(
void
);
void
adjust_viewport
(
update_type
location
);
...
...
This diff is collapsed.
Click to expand it.
src/winio.c
View file @
09723b07
...
...
@@ -3047,34 +3047,6 @@ size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
return
(
editwincols
>
1
)
?
prev_column
:
column
-
1
;
}
/* When in softwrap mode, and the given column is on or after the breakpoint of
* a softwrapped chunk, shift it back to the last column before the breakpoint.
* The given column is relative to the given leftedge in current. The returned
* column is relative to the start of the text. */
size_t
actual_last_column
(
size_t
leftedge
,
size_t
column
)
{
#ifndef NANO_TINY
if
(
ISSET
(
SOFTWRAP
))
{
size_t
end_col
;
bool
last_chunk
;
end_col
=
get_softwrap_breakpoint
(
openfile
->
current
->
data
,
leftedge
,
&
last_chunk
)
-
leftedge
;
/* If we're not on the last chunk, we're one column past the end of
* the row. Shifting back one column might put us in the middle of
* a multi-column character, but actual_x() will fix that later. */
if
(
!
last_chunk
)
end_col
--
;
if
(
column
>
end_col
)
column
=
end_col
;
}
#endif
return
leftedge
+
column
;
}
/* Get the row of the softwrapped chunk of the given line that column is on,
* relative to the first row (zero-based), and return it. If leftedge isn't
* NULL, return the leftmost column of the chunk in it. */
...
...
@@ -3134,8 +3106,34 @@ void ensure_firstcolumn_is_aligned(void)
/* If smooth scrolling is on, make sure the viewport doesn't center. */
focusing
=
FALSE
;
}
#endif
/* !NANO_TINY */
/* When in softwrap mode, and the given column is on or after the breakpoint of
* a softwrapped chunk, shift it back to the last column before the breakpoint.
* The given column is relative to the given leftedge in current. The returned
* column is relative to the start of the text. */
size_t
actual_last_column
(
size_t
leftedge
,
size_t
column
)
{
#ifndef NANO_TINY
if
(
ISSET
(
SOFTWRAP
))
{
bool
last_chunk
;
size_t
end_col
=
get_softwrap_breakpoint
(
openfile
->
current
->
data
,
leftedge
,
&
last_chunk
)
-
leftedge
;
/* If we're not on the last chunk, we're one column past the end of
* the row. Shifting back one column might put us in the middle of
* a multi-column character, but actual_x() will fix that later. */
if
(
!
last_chunk
)
end_col
--
;
if
(
column
>
end_col
)
column
=
end_col
;
}
#endif
return
leftedge
+
column
;
}
/* Return TRUE if current[current_x] is above the top of the screen, and FALSE
* otherwise. */
bool
current_is_above_screen
(
void
)
...
...
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