clean up the partitioning-related if blocks
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2060 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
f643fc2149
commit
dcc201b5b2
21
src/search.c
21
src/search.c
|
@ -787,34 +787,33 @@ ssize_t do_replace_loop(const char *needle, const filestruct
|
||||||
length_change = strlen(copy) - strlen(current->data);
|
length_change = strlen(copy) - strlen(current->data);
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
/* Keep mark_beginx in sync with the text changes. */
|
/* If the mark was on and (mark_beginbuf, mark_begin_x) was
|
||||||
if (current == mark_beginbuf && mark_beginx > current_x) {
|
* the top of it, don't change mark_beginx. */
|
||||||
/* If the mark was on and (mark_beginbuf, mark_begin_x)
|
|
||||||
* was the top of it, don't change mark_beginx. */
|
|
||||||
if (!old_mark_set || !right_side_up) {
|
if (!old_mark_set || !right_side_up) {
|
||||||
|
/* Keep mark_beginx in sync with the text changes. */
|
||||||
|
if (current == mark_beginbuf && mark_beginx >
|
||||||
|
current_x) {
|
||||||
if (mark_beginx < current_x + match_len)
|
if (mark_beginx < current_x + match_len)
|
||||||
mark_beginx = current_x;
|
mark_beginx = current_x;
|
||||||
else
|
else
|
||||||
mark_beginx += length_change;
|
mark_beginx += length_change;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/* If the mark was on and (current, current_x) was the top
|
||||||
|
* of it, don't change real_current_x. */
|
||||||
|
if (!old_mark_set || right_side_up) {
|
||||||
|
#endif
|
||||||
/* Keep real_current_x in sync with the text changes. */
|
/* Keep real_current_x in sync with the text changes. */
|
||||||
if (current == real_current && current_x <=
|
if (current == real_current && current_x <=
|
||||||
*real_current_x) {
|
*real_current_x) {
|
||||||
#ifndef NANO_SMALL
|
|
||||||
/* If the mark was on and (current, current_x) was the
|
|
||||||
* top of it, don't change real_current_x. */
|
|
||||||
if (!old_mark_set || right_side_up) {
|
|
||||||
#endif
|
|
||||||
if (*real_current_x < current_x + match_len)
|
if (*real_current_x < current_x + match_len)
|
||||||
*real_current_x = current_x + match_len;
|
*real_current_x = current_x + match_len;
|
||||||
*real_current_x += length_change;
|
*real_current_x += length_change;
|
||||||
|
}
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the cursor at the last character of the replacement
|
/* Set the cursor at the last character of the replacement
|
||||||
* text, so searching will resume after the replacement
|
* text, so searching will resume after the replacement
|
||||||
|
|
Loading…
Reference in New Issue