diff --git a/src/cut.c b/src/cut.c index 0f33e1d4b030ff7c522fef3a3490ea0ddb8204c7..0341c598f744bfbf06ece06c4b18202db1021761 100644 --- a/src/cut.c +++ b/src/cut.c @@ -24,15 +24,6 @@ #include <string.h> -static bool keep_cutbuffer = FALSE; - /* Should we keep the contents of the cutbuffer? */ - -/* Indicate that we should no longer keep the contents of the cutbuffer. */ -void cutbuffer_reset(void) -{ - keep_cutbuffer = FALSE; -} - /* If we aren't on the last line of the file, move all the text of the * current line, plus the newline at the end, into the cutbuffer. If we * are, move all of the text of the current line into the cutbuffer. In @@ -217,7 +208,7 @@ void do_copy_text(void) size_t is_current_x = openfile->current_x; if (mark_is_set || openfile->current != next_contiguous_line) - cutbuffer_reset(); + keep_cutbuffer = FALSE; do_cut_text(TRUE, mark_is_set, FALSE, FALSE); diff --git a/src/global.c b/src/global.c index a11ccdba90ab3b57629f2a84dbd44a40c130f1fd..0368132f65a6933bd65ea951c9e605782903f91a 100644 --- a/src/global.c +++ b/src/global.c @@ -116,6 +116,9 @@ filestruct *cutbuffer = NULL; /* The buffer where we store cut text. */ filestruct *cutbottom = NULL; /* The last line in the cutbuffer. */ +bool keep_cutbuffer = FALSE; + /* Whether to add to the cutbuffer instead of clearing it first. */ + partition *filepart = NULL; /* The "partition" where we store a portion of the current file. */ openfilestruct *openfile = NULL; diff --git a/src/nano.c b/src/nano.c index 6eb3f2ac63e6687d1a445201fe3b8e9691b3b49d..ff4b9a27fa887e1d1b0107a2b9a89f374c4797ae 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1618,7 +1618,7 @@ int do_mouse(void) else #endif /* The cursor moved; clean the cutbuffer on the next cut. */ - cutbuffer_reset(); + keep_cutbuffer = FALSE; edit_redraw(current_save, CENTERING); } @@ -1823,7 +1823,7 @@ void do_input(void) /* If we aren't cutting or copying text, and the key wasn't a toggle, * blow away the text in the cutbuffer upon the next cutting action. */ if (!retain_cuts) - cutbuffer_reset(); + keep_cutbuffer = FALSE; } /* The user typed output_len multibyte characters. Add them to the edit diff --git a/src/proto.h b/src/proto.h index c3db00ffc07d82d44d1b329f61212862366dfb98..2f6c14cd27d748d9e2054e909dc9e7013d797aec 100644 --- a/src/proto.h +++ b/src/proto.h @@ -91,6 +91,8 @@ extern int margin; extern filestruct *cutbuffer; extern filestruct *cutbottom; +extern bool keep_cutbuffer; + extern partition *filepart; extern openfilestruct *openfile; extern openfilestruct *firstfile; @@ -241,7 +243,6 @@ void precalc_multicolorinfo(void); #endif /* Most functions in cut.c. */ -void cutbuffer_reset(void); #ifndef NANO_TINY void cut_marked(bool *right_side_up); #endif