Skip to content
Snippets Groups Projects
Commit ae61f665 authored by rswindell's avatar rswindell
Browse files

Don't set the API "changes" flag when just searching for text and editing

the find-text string.
parent 0fba11fc
No related branches found
No related tags found
No related merge requests found
...@@ -205,6 +205,7 @@ ...@@ -205,6 +205,7 @@
/* Input area (NOT outside of window!) */ /* Input area (NOT outside of window!) */
/* And ungets the mouse event. */ /* And ungets the mouse event. */
#define K_PASSWORD (1L<<16) /* Does not display text while editing */ #define K_PASSWORD (1L<<16) /* Does not display text while editing */
#define K_FIND (1L<<17) /* Don't set the "changes" flag */
/* Extra exit flags */ /* Extra exit flags */
......
...@@ -1714,7 +1714,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -1714,7 +1714,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
case CTRL_F: /* find */ case CTRL_F: /* find */
case CTRL_G: case CTRL_G:
if(/*!(api->mode&UIFC_NOCTRL)*/1) { // No no, *this* control key is fine! if(/*!(api->mode&UIFC_NOCTRL)*/1) { // No no, *this* control key is fine!
if (gotkey == CTRL_G || api->input(WIN_MID|WIN_SAV, 0, 0, "Find", search, sizeof(search), K_EDIT) > 0) { if (gotkey == CTRL_G || api->input(WIN_MID|WIN_SAV, 0, 0, "Find", search, sizeof(search), K_EDIT|K_FIND) > 0) {
for (j = (*cur) + 1; j != *cur; j++, j = (j >= opts) ? 0 : j) { for (j = (*cur) + 1; j != *cur; j++, j = (j >= opts) ? 0 : j) {
if (strcasestr(option[j], search) != NULL) { if (strcasestr(option[j], search) != NULL) {
// Copy/pasted from search above. // Copy/pasted from search above.
...@@ -2370,12 +2370,12 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int ...@@ -2370,12 +2370,12 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
if(mode&K_EDIT) if(mode&K_EDIT)
{ {
truncspctrl(str); truncspctrl(str);
if(strcmp(outstr,str)) if(!(mode&K_FIND) && strcmp(outstr,str))
api->changes=1; api->changes=1;
} }
else else
{ {
if(j) if(!(mode&K_FIND) && j)
api->changes=1; api->changes=1;
} }
strcpy(outstr,str); strcpy(outstr,str);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment