aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--src/nnn.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/README.md b/README.md
index bf83b2e..201e161 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@
<a href="https://travis-ci.org/jarun/nnn"><img src="https://img.shields.io/travis/jarun/nnn/master.svg?label=travis" alt="Travis Status" /></a>
<a href="https://circleci.com/gh/jarun/workflows/nnn"><img src="https://img.shields.io/circleci/project/github/jarun/nnn.svg?label=circleci" alt="CircleCI Status" /></a>
<a href="https://github.com/jarun/nnn/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-BSD%202--Clause-yellow.svg?maxAge=2592000" alt="License" /></a>
+<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><img src="https://img.shields.io/badge/PayPal-donate-1eb0fc.svg" alt="Donate via PayPal!" /></a>
</p>
<p align="center">
diff --git a/src/nnn.c b/src/nnn.c
index 4773bfe..dec8681 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -917,7 +917,7 @@ static void resetcpind(void)
}
/* Initialize curses mode */
-static bool initcurses(void)
+static bool initcurses(mmask_t *oldmask)
{
short i;
@@ -942,9 +942,9 @@ static bool initcurses(void)
//intrflush(stdscr, FALSE);
keypad(stdscr, TRUE);
#if NCURSES_MOUSE_VERSION <= 1
- mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED, NULL);
+ mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED, oldmask);
#else
- mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL);
+ mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED | BUTTON4_PRESSED | BUTTON5_PRESSED, oldmask);
#endif
mouseinterval(400);
curs_set(FALSE); /* Hide cursor */
@@ -4704,6 +4704,7 @@ static void cleanup(void)
int main(int argc, char *argv[])
{
+ mmask_t mask;
char *arg = NULL;
int opt;
#ifdef __linux__
@@ -4971,10 +4972,11 @@ int main(int argc, char *argv[])
read_history(g_buf);
#endif
- if (!initcurses())
+ if (!initcurses(&mask))
return _FAILURE;
browse(initpath);
+ mousemask(mask, NULL);
exitcurses();
#ifndef NORL