Remove duplicate history entries in command buffer
Kornel Benko
kornel at lyx.org
Wed Jul 13 15:49:58 UTC 2022
Am Wed, 13 Jul 2022 17:06:33 +0200
schrieb Jean-Marc Lasgouttes <lasgouttes.lyx.org at free.fr>:
> Le 13/07/2022 à 11:24, Kornel Benko a écrit :
> > Am Wed, 13 Jul 2022 11:14:53 +0200
> > schrieb Jean-Marc Lasgouttes <lasgouttes.lyx.org at free.fr>:
> >
> >> Le 13/07/2022 à 09:43, Kornel Benko a écrit :
> >>>>> I suspect that the two command
> >>>>> lists should be unified.
> >>>
> >>> Maybe in 2.5?
> >>
> >> I'll have a look.
> >
> > Thanks.
>
> Here is a patch, which nicely removes more lines than it adds.
>
> You can see the erase-remove idiom in action in LastCommandSection::add().
>
> Please test.
>
> JMarc
>
Works nice. As expected, only the newly entered command is made uniq.
Checking with an used session-file
$ cat session | wc
579 1240 16707
$ cat session | sort | uniq | wc
180 580 8709
One can see, there are many duplicates.
$ lyx
// use one of the duplicated commands ('regexp-mode' in this case)
$ cat session | wc
294 955 13287
$ cat session | sort | uniq | wc
180 580 8709
--> This shows, that no non-duplicated command is removed.
IMHO this should go in.
Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220713/470e8b3f/attachment.asc>
More information about the lyx-devel
mailing list