tweaks: elide an unneeded parameter, as the function already assumes it
The do_wrap() function always gets 'openfile->current' as parameter, and, internally, it assumes that it is handling the current line.master
parent
8613285321
commit
286c877853
|
@ -1920,7 +1920,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
|
|||
|
||||
#ifdef ENABLE_WRAPPING
|
||||
/* If text gets wrapped, the edit window needs a refresh. */
|
||||
if (ISSET(BREAK_LONG_LINES) && do_wrap(openfile->current))
|
||||
if (ISSET(BREAK_LONG_LINES) && do_wrap())
|
||||
refresh_needed = TRUE;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -524,7 +524,7 @@ void update_undo(undo_type action);
|
|||
#endif /* !NANO_TINY */
|
||||
#ifdef ENABLE_WRAPPING
|
||||
void wrap_reset(void);
|
||||
bool do_wrap(linestruct *line);
|
||||
bool do_wrap(void);
|
||||
#endif
|
||||
#if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY)
|
||||
ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl);
|
||||
|
|
10
src/text.c
10
src/text.c
|
@ -1419,9 +1419,11 @@ void wrap_reset(void)
|
|||
prepend_wrap = FALSE;
|
||||
}
|
||||
|
||||
/* Try wrapping the given line. Return TRUE if wrapped, FALSE otherwise. */
|
||||
bool do_wrap(linestruct *line)
|
||||
/* Try to wrap the current line. Return TRUE if wrapped, FALSE otherwise. */
|
||||
bool do_wrap(void)
|
||||
{
|
||||
linestruct *line = openfile->current;
|
||||
/* The line that will be wrapped, if needed and possible. */
|
||||
size_t line_len = strlen(line->data);
|
||||
/* The length of the line we wrap. */
|
||||
ssize_t wrap_loc;
|
||||
|
@ -1472,8 +1474,6 @@ bool do_wrap(linestruct *line)
|
|||
add_undo(SPLIT_BEGIN);
|
||||
#endif
|
||||
|
||||
openfile->current = line;
|
||||
|
||||
/* Step 2, making the new wrap line. It will consist of indentation
|
||||
* followed by the text after the wrap point, optionally followed by
|
||||
* a space (if the text after the wrap point doesn't end in a blank)
|
||||
|
@ -3342,7 +3342,7 @@ void complete_a_word(void)
|
|||
/* If needed, reenable wrapping and wrap the current line. */
|
||||
if (was_set_wrapping) {
|
||||
SET(BREAK_LONG_LINES);
|
||||
do_wrap(openfile->current);
|
||||
do_wrap();
|
||||
}
|
||||
#endif
|
||||
/* Set the position for a possible next search attempt. */
|
||||
|
|
Loading…
Reference in New Issue