Commit 7cfea8bb authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in mark_order(), add check for MARK_ISSET's not being set; also make one

more int -> bool conversion and cosmetic fix


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1974 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 10 additions and 3 deletions
+10 -3
......@@ -154,6 +154,9 @@ CVS code -
wholewords, not after all other parameters. (DLR)
- Maintain current_y's value when moving up or down lines so
that smooth scrolling works correctly. (DLR)
- utils.c:
mark_order()
- Add check for MARK_ISSET's not being set. (DLR)
- winio.c:
unget_kbinput()
- New function used as a wrapper for ungetch(). (DLR)
......
......@@ -1719,7 +1719,7 @@ int write_marked(const char *name, int tmp, int append)
int retval = -1;
filestruct *fileagebak = fileage;
filestruct *filebotbak = filebot;
int oldmod = ISSET(MODIFIED);
bool old_modified = ISSET(MODIFIED);
/* write_file() unsets the MODIFIED flag. */
size_t topx;
/* The column of the beginning of the mark. */
......@@ -1730,7 +1730,7 @@ int write_marked(const char *name, int tmp, int append)
/* The location of the character we nulled. */
if (!ISSET(MARK_ISSET))
return -1;
return retval;
/* Set fileage as the top of the mark, and filebot as the bottom. */
if (current->lineno > mark_beginbuf->lineno ||
......@@ -1763,7 +1763,7 @@ int write_marked(const char *name, int tmp, int append)
*origcharloc = origchar;
fileage = fileagebak;
filebot = filebotbak;
if (oldmod)
if (old_modified)
set_modified();
return retval;
......
......@@ -441,6 +441,10 @@ void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x)
{
assert(top != NULL && top_x != NULL && bot != NULL && bot_x != NULL);
if (!ISSET(MARK_ISSET))
return;
if ((current->lineno == mark_beginbuf->lineno && current_x > mark_beginx)
|| current->lineno > mark_beginbuf->lineno) {
*top = mark_beginbuf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment