Ticket #3203 (new defect)

Opened 6 years ago

Last modified 5 years ago

[patch] mcedit: replace dialog doesn't remember last entered replacement string

Reported by: Polynomial-C Owned by:
Priority: minor Milestone: Future Releases
Component: mcedit Version: 4.8.12
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

I found this in mc-4.8.12. mc-4.8.11 didn't have this problem.

Edit a file with mcedit and search/replace (F4) a string. Let's say I added "a" as search string and "b" as replacement string. Then I do a couple of replacements with that and exit the dialog (press ESC or Cancel). When re-opening the Replace dialog again, "a" is still in the search string but the replacement string is empty. I expect mc to remember the replacement string as it did in previous versions.

Built with GLib 2.38.2
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

Attachments

mc-4.8.13-restore_saved_replace_string.patch (714 bytes) - added by and 5 years ago.
restore saved replace string

Change History

Changed 5 years ago by and

restore saved replace string

comment:1 Changed 5 years ago by and

  • Summary changed from mcedit: replace dialog doesn't remember last entered replacement string to [patch] mcedit: replace dialog doesn't remember last entered replacement string

comment:2 Changed 5 years ago by andrew_b

    if ((replace_default == NULL) || (*replace_default == '\0')) 
        replace_default = INPUT_LAST_TEXT;

An empty string is valid for replacement. "Replace by nothing" is useful case.

Note: See TracTickets for help on using tickets.