bugGNU nano - Bugs: bug #58825, stuff after a Search command in a...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58825: stuff after a Search command in a macro can get skipped

Submitter:  Benno Schulenberg <bens>
Submitted:  Sat 25 Jul 2020 09:45:56 AM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Tue 25 Aug 2020 06:39:23 AM UTC, comment #7: 

Released in 5.2.

Benno Schulenberg <bens>
Group administrator
Thu 20 Aug 2020 09:00:18 AM UTC, comment #6: 

Fixed in git, commit 92298349, by using wgetch() to look at the "keyboard" directly.  It is followed by several clean-up patches, among them aa257ef5 for restoring the resizability.

Benno Schulenberg <bens>
Group administrator
Thu 06 Aug 2020 04:42:15 PM UTC, comment #5: 

Hi Benno,

Yes, I still use the macro feature, especially with search(-again) although for complex cases that don't require full unicode support I tend to switch to ne. I haven't fully been able to analyze all the reasons for that, but part of it might be that it wasn't always working due to the problem you describe.

(Sorry for the delayed reply, I am on a holiday and away from my work computer...)

Cheers,
Peter

Peter Passchier <pepa65>
Sun 26 Jul 2020 11:38:05 AM UTC, comment #4: 

Hello Peter,

Some years ago you requested the macro feature.  Do you still use it regularly?

Last week I have used a macro maybe for the fourth or fifth time, this time to transform each of twenty lines in the same way.  It was quite useful.  But then I realized: when using a Search command in a macro (like ^W or M-W), things that come after this command could get discarded/ignored when the search happens on the rollover point of second, because then the Search routine will check the "keyboard" and will throw away everything in the buffer that is not a Cancel command (normally ^C), and this probably means: the whole rest of the macro.  :|

So, the question is: do you sometimes use a Search command in a macro?  And if so, have you ever noticed that it malfunctioned?

(Anyway, I will fix this issue at some point, but it will take some rearranging of a bunch of stuff.  It will take a while.)

Benno Schulenberg <bens>
Group administrator
Sat 25 Jul 2020 01:54:05 PM UTC, comment #3: 

Well, it's possible to use wgetch() and, if there is a character, put it back at the head of the keybuffer, and then get it from the buffer normally.  But then resizing while nano is searching does not work.  The latter is not very important, but... I don't want to sacrifice it for this issue.

Benno Schulenberg <bens>
Group administrator
Sat 25 Jul 2020 01:46:26 PM UTC, comment #2: 

^C after M-W doesn't work because 'meta_key' does not get reset to false when the normal input-parsing routines are not called.

Benno Schulenberg <bens>
Group administrator
Sat 25 Jul 2020 01:11:21 PM UTC, comment #1: 

When I simply replace the two calls of parse_kbinput(edit) in src/search.c with calls of wgetch(edit), it works fine when using ^W <Enter>.  But ^C (Cancel) doesn't do anything when using M-W to search again.  :|  I don't get it.  Why!?

Benno Schulenberg <bens>
Group administrator
Sat 25 Jul 2020 09:45:56 AM UTC, original submission:  

To reproduce, first create a file with some two million lines:

for x in $(seq 98); do cat src/*.c; done  >2million

Then run 'src/nano --ignore 2million'.  It takes about two seconds to load.  Then define a macro (after the <Enter> wait for it to report "not found"):
M-: ^W foofoo <Enter> Hello! M-:
Then execute the macro: M-;
See that after reporting "not found" no extra "Hello!" is entered into the buffer.  Not good.

Expected behavior: the Search function should poll the 'keyboard' directly, it should leave nano's keyboard buffer alone -- anything that is already in there should stay there.

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pepa65 (Posted a comment)
  • -email is unavailable- added by bens
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-25 bens Open/ClosedOpen Closed
    2020-08-23 bens Severity3 - Normal 4 - Important
    2020-08-20 bens StatusIn Progress Fixed
    2020-08-19 bens Severity2 - Minor 3 - Normal
        StatusNone In Progress
    2020-07-26 bens Carbon-Copy- Added pepa65

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code