Howto modify selection from replace buffer (FindAdv)
spitz at lyx.org
Sat Jan 9 11:58:16 UTC 2021
Am Freitag, dem 08.01.2021 um 11:39 +0100 schrieb Kornel Benko:
> I have problems to _use_ matched substrings in replace-mode.
> For instance given regular expression containing some groups, like
> and I want to change the found value to 'yyyyzzzzxxxx', so in regex I
> would write
> Now the selection contains '\3\2\1', this is selected (in
> > buffer().errorList("Paste"));
> LYXERR(Debug::FIND, "After pasteParagraphList() cur="
> << cur << endl);
> sel_len = repl_buffer.paragraphs().begin()->size();
> and then follows
> bv->putSelectionAt(DocIterator(cur), sel_len, !opt.forward);
> How can I modify the data prior to inserting into buffer ?
> The values of '\1', '\2', '\3' are known here, but are not used.
I think you should write a function similar to changeFirstCase() that
iterates over repl_buffer and replaces the placeholder in all
paragraphs. Then the cap::pasteParagraphList() function in question
should insert the modified paragraph(s).
I don't know how difficult such a function would be, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: This is a digitally signed message part
More information about the lyx-devel