nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] address@hidden: Bug#315199: nano: 'To Files' forgets se


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] address@hidden: Bug#315199: nano: 'To Files' forgets selected file]
Date: Tue, 21 Jun 2005 10:21:25 -0400
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050317)

Jordi Mallach <address@hidden> wrote:

>Hi!
>
>I got the following bug against 1.3.7 in Debian.

Wouter Van Hemel <address@hidden> wrote:

<snip>

>'To Files' seems to loose the file selected in the directory browser.
>
>How to reproduce:
>
>open nano
>type ^R (File to insert:)
>type ^T (To Files)
>select a file from the list
>press ENTER
>
>Result:
>File to insert: [BLANK]
>
>Expected result:
>File to insert: [SELECTED FILENAME]
>
>Version string (stock Debian unstable package):
>GNU nano version 1.3.7 (compiled 08:19:45, Jun 16 2005)
>
>I guess the filebrowser is supposed to return the selected filename so
>it gets inserted into the prompt and it only needs an enter to confirm.
>
>Thanks in advance!

I found and fixed this in CVS 2 weeks ago.  It turns out my fix in 1.3.7
to keep the user from being kicked out of the "Insert File" prompt after
exiting the help browser is what caused the breakage.  The attached
patch against 1.3.7 should fix it.

diff -ur nano-1.3.7/src/files.c nano-1.3.7-fixed/src/files.c
--- nano-1.3.7/src/files.c      2005-04-10 23:51:22.000000000 -0400
+++ nano-1.3.7-fixed/src/files.c        2005-06-21 10:08:24.000000000 -0400
@@ -565,7 +565,8 @@
 
            ans = mallocstrcpy(ans, answer);
 
-#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
+#ifndef NANO_SMALL
+#ifdef ENABLE_MULTIBUFFER
            if (i == TOGGLE_MULTIBUFFER_KEY) {
                /* Don't allow toggling if we're in view mode. */
                if (!ISSET(VIEW_MODE))
@@ -574,6 +575,12 @@
            }
 #endif
 
+           if (i == NANO_TOOTHERINSERT_KEY) {
+               execute = !execute;
+               continue;
+           }
+#endif /* !NANO_SMALL */
+
 #ifndef DISABLE_BROWSER
            if (i == NANO_TOFILES_KEY) {
                char *tmp = do_browse_from(answer);
@@ -584,19 +591,13 @@
                free(answer);
                answer = tmp;
 
-               /* We have a file now.  Get out of the statusbar prompt
-                * cleanly. */
+               /* We have a file now.  Indicate this and get out of the
+                * statusbar prompt cleanly. */
+               i = 0;
                statusq_abort();
            }
 #endif
 
-#ifndef NANO_SMALL
-           if (i == NANO_TOOTHERINSERT_KEY) {
-               execute = !execute;
-               continue;
-           }
-#endif
-
            /* If we don't have a file yet, go back to the statusbar
             * prompt. */
            if (i != 0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]