do_home(), do_end(), do_up(), do_scroll_up(), do_down(),
do_scroll_down(), do_left(), do_right(), do_indent_marked(),
and get_kbinput(). (Benno Schulenberg, minor tweaks by DLR)
+ - Handle prepending of wrapped text in one place instead of
+ many, so that it always works consistently. Changes to
+ do_uncut_text(), do_insertfile(), do_page_up(),
+ do_page_down(), do_up(), do_scroll_up(), do_down(),
+ do_scroll_down(), do_input(), do_search(), do_research(), and
+ do_delete(). (DLR)
- browser.c:
do_browser()
- Reference NANO_GOTODIR_(ALT|F)?KEY instead of
{
assert(openfile->current != NULL && openfile->current->data != NULL);
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If the cutbuffer is empty, get out. */
if (cutbuffer == NULL)
return;
bool at_edittop = FALSE;
/* Whether we're at the top of the edit window. */
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
while (TRUE) {
#ifndef NANO_TINY
if (execute) {
{
int i;
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If there's less than a page of text left on the screen, put the
* cursor at the beginning of the first line of the file, and then
* update the edit window. */
{
int i;
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If there's less than a page of text left on the screen, put the
* cursor at the beginning of the last line of the file, and then
* update the edit window. */
/* Move up one line. */
void do_up(void)
{
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If we're at the top of the file, get out. */
if (openfile->current == openfile->fileage)
return;
/* Scroll up one line without scrolling the cursor. */
void do_scroll_up(void)
{
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If the top of the file is onscreen, get out. */
if (openfile->edittop == openfile->fileage)
return;
/* Move down one line. */
void do_down(void)
{
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If we're at the bottom of the file, get out. */
if (openfile->current == openfile->filebot)
return;
/* Scroll down one line without scrolling the cursor. */
void do_scroll_down(void)
{
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
/* If we're at the bottom of the file, get out. */
if (openfile->current == openfile->filebot)
return;
/* If we got a shortcut or toggle, or if there aren't any other
* characters waiting after the one we read in, we need to
- * display all the characters in the input buffer if it isn't
+ * output all the characters in the input buffer if it isn't
* empty. Note that it should be empty if we're in view
* mode. */
if (*s_or_t == TRUE || get_key_buffer_len() == 0) {
+ /* If we got a shortcut or toggle, turn off prepending of
+ * wrapped text. */
+ if (*s_or_t == TRUE)
+ wrap_reset();
+
if (kbinput != NULL) {
/* Display all the characters in the input buffer at
* once, filtering out control characters. */
}
#endif /* !DISABLE_MOUSE */
-/* The user typed ouuput_len multibyte characters. Add them to the edit
+/* The user typed output_len multibyte characters. Add them to the edit
* buffer, filtering out all control characters if allow_cntrls is
* TRUE. */
void do_output(char *output, size_t output_len, bool allow_cntrls)
int i;
bool didfind;
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
i = search_init(FALSE, FALSE);
- if (i == -1) /* Cancel, Go to Line, blank search string, or
- * regcomp() failed. */
+
+ if (i == -1)
+ /* Cancel, Go to Line, blank search string, or regcomp()
+ * failed. */
search_replace_abort();
- else if (i == -2) /* Replace. */
+ else if (i == -2)
+ /* Replace. */
do_replace();
#if !defined(NANO_TINY) || defined(HAVE_REGEX_H)
- else if (i == 1) /* Case Sensitive, Backwards, or Regexp search
- * toggle. */
+ else if (i == 1)
+ /* Case Sensitive, Backwards, or Regexp search toggle. */
do_search();
#endif
size_t old_pww = openfile->placewewant;
bool didfind;
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
-
search_init_globals();
if (last_search[0] != '\0') {
}
i = search_init(TRUE, FALSE);
- if (i == -1) { /* Cancel, Go to Line, blank search
- * string, or regcomp() failed. */
+ if (i == -1) {
+ /* Cancel, Go to Line, blank search string, or regcomp()
+ * failed. */
search_replace_abort();
return;
- } else if (i == -2) { /* No Replace. */
+ } else if (i == -2) {
+ /* No Replace. */
do_search();
return;
- } else if (i == 1) /* Case Sensitive, Backwards, or Regexp
- * search toggle. */
+ } else if (i == 1)
+ /* Case Sensitive, Backwards, or Regexp search toggle. */
do_replace();
if (i != 0)
delete_node(foo);
renumber(openfile->current);
openfile->totsize--;
-#ifndef DISABLE_WRAPPING
- wrap_reset();
-#endif
/* If the NO_NEWLINES flag isn't set, and text has been added to
* the magicline as a result of deleting at the end of the line
#endif /* !NANO_TINY */
#ifndef DISABLE_WRAPPING
-/* Clear the prepend_wrap flag. We need to do this as soon as we do
+/* Unset the prepend_wrap flag. We need to do this as soon as we do
* something other than type text. */
void wrap_reset(void)
{