Am Sun, 14 Aug 2022 09:27:40 +0200 schrieb Daniel <xraco...@gmx.de>: > On 2022-08-10 04:15, Daniel wrote: > > It would be nice if LyX's source editors (for Local Layout and LaTeX > > Preamble) would have proper indentation and (un)commenting support. > > > > I know that the external editing is supported now, but I consider this > > more of a pro feature since it presupposes already having set up an > > editor (other than the standard Windows and macOS text editors) and even > > then it seems often unnecessary cumbersome to use. > > > > In the attached Qt project, I implemented those features. It probably > > needs some more cleaning up. But it seems to work and you could already > > try it out if you like. The (un)commenting feature leans heavily on code > > from QtCreator. (I tried to improve a bit upon it, e.g. comments are > > added at the deepest common indentation as in > > > > > > Begin > > % Comment > > Code > > End > > > > > > and it is possible to start a comment in an empty line. Both seem to me > > quite a bit of an oversight in Qt Creator.) > > > > If there is interest, what I would at least need help with for bringing > > this over to LyX is a basic setup of the "GuiSourceEdit" class. I tried > > it but failed (linker error). I guess it should be in its own > > h/.cpp file. It could already have the constructor as in the attached > > "mainwindow.h" which is code from the source text edits in > > "GuiDocument.cpp". I could then add all the other stuff when it is ready > > but, first, I wanted to make sure that there is some interest. > > > > Daniel > > > > Managed to get the files working. Attached is the patch to extend LyX's > source code editing facilities. (I would have posted it on trac but the > login is not working currently.) > > Daniel
Applies cleanly and compiles. Rudimentary test looks good. (At least writing local format feels better than what we have now). Kornel
pgpCqbZrzlr2B.pgp
Description: Digitale Signatur von OpenPGP
-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel