Re: Text completion
On Wed, Nov 29, 2023 at 03:05:17PM +0100, Jean-Marc Lasgouttes wrote: > Le 29/11/2023 à 13:26, Daniel a écrit : > > I tried to use text completion for a bit now. Is it correct that the > > feature is kind of experimental? > > No, it is supposed to work. However, the author of this code is now gone. Does any developer use this feature? Just curious. Scott signature.asc Description: PGP signature -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Text completion
Le 29/11/2023 à 13:26, Daniel a écrit : I tried to use text completion for a bit now. Is it correct that the feature is kind of experimental? No, it is supposed to work. However, the author of this code is now gone. I am asking because unless I misunderstood how it works, it seems to have a couple of quirks. For example, the list of words ("popup") sometimes misses words or shows words that don't match. Create tickets, we will try to fix them (it is not a promise from me :) JMarc -- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Text completion
On 2023-11-29 13:26, Daniel wrote: I tried to use text completion for a bit now. Is it correct that the feature is kind of experimental? I am asking because unless I misunderstood how it works, it seems to have a couple of quirks. For example, the list of words ("popup") sometimes misses words or shows words that don't match. Daniel Attached is an example of missing words. And when I write one of the missing words in a new line, it all of a sudden adds the word. Daniel-- lyx-devel mailing list lyx-devel@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-devel
Re: Text completion and RTL
Stefan Schimanski wrote: Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Thanks, I'll take a look at this. But I'll be a few days though... Stefan
Re: Text completion not working in tables?
Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... Stefan
Re: Text completion and RTL
Am 14.03.2008 um 15:25 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Thanks, I'll take a look at this. But I'll be a few days though... Sure, no problem. Btw, do you use a rtl locale for the gui? I mean maybe your Qt does some RTL magic which mine does not. Just an idea... Stefan
Re: Text completion and RTL
Stefan Schimanski wrote: Am 14.03.2008 um 15:25 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Thanks, I'll take a look at this. But I'll be a few days though... Sure, no problem. Btw, do you use a rtl locale for the gui? I mean maybe your Qt does some RTL magic which mine does not. Just an idea... I'll keep this possibility in mind, thanks... Stefan
Re: Text completion not working in tables?
Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Stefan
Re: Text completion not working in tables?
Am 14.03.2008 um 15:26 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... AFAIK it only uses the Text class for every cell. Otherwise the cursor would need another slice for the table and the InsetText, and hence many special handling to avoid strange positions which are in the table, but not in the InsetText. Stefan
Re: Text completion and RTL
Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I can explain why it is happening (and why this problem wasn't observed when RTL was tested with latin characters), but I don't know how to easily solve the issue. The reason is something like this: when painting text, LyX applies the bidi algorithm, so that the string that it ultimately passes to Qt for painting is already in visual order; however, Qt 4 now applies its own bidi algorithm to all strings that it paints, and it doesn't seem to provide any API for saying the string is already in visual order, just paint it as it is. To get around this problem, we paint RTL strings one character at a time (see http://www.lyx.org/trac/browser/lyx-devel/trunk/src/rowpainter.cpp?rev=23522#L259) . But I imagine that the grayed-out inline completion is painted as a full string... I haven't looked at the completion code at all, so I'm not sure exactly what's going on; but I'm pretty sure that this is the correct explanation of the problem. Any ideas on what can be done to solve it? I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Stefan
Re: Text completion not working in tables?
On Fri, Mar 14, 2008 at 03:19:32PM +0100, Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Or move it to Text, which is shared by InsetText and InsetTabular? Andre'
Re: Text completion not working in tables?
Am 14.03.2008 um 20:13 schrieb Andre Poenitz: On Fri, Mar 14, 2008 at 03:19:32PM +0100, Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Or move it to Text, which is shared by InsetText and InsetTabular? Will try that. Stefan
Re: Text completion not working in tables?
Stefan Schimanski wrote: Am 14.03.2008 um 15:26 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... AFAIK it only uses the Text class for every cell. Otherwise the cursor would need another slice for the table and the InsetText, and hence many special handling to avoid strange positions which are in the table, but not in the InsetText. I don't think this is a good thing personally. Cells should be insets. I am pretty sure the code will be less complicated if that was the case. Abdel.
Re: Text completion not working in tables?
On Fri, Mar 14, 2008 at 11:15:48PM +0100, Abdelrazak Younes wrote: Stefan Schimanski wrote: Am 14.03.2008 um 15:26 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... AFAIK it only uses the Text class for every cell. Otherwise the cursor would need another slice for the table and the InsetText, and hence many special handling to avoid strange positions which are in the table, but not in the InsetText. I don't think this is a good thing personally. Cells should be insets. I am pretty sure the code will be less complicated if that was the case. I always thought a bit like Text == Model, InsetText == View. But of course, the metrics stuff completely defeats this... Andre'
Re: Text completion and RTL
Stefan Schimanski wrote: Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Thanks, I'll take a look at this. But I'll be a few days though... Stefan
Re: Text completion not working in tables?
Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... Stefan
Re: Text completion and RTL
Am 14.03.2008 um 15:25 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Thanks, I'll take a look at this. But I'll be a few days though... Sure, no problem. Btw, do you use a rtl locale for the gui? I mean maybe your Qt does some RTL magic which mine does not. Just an idea... Stefan
Re: Text completion and RTL
Stefan Schimanski wrote: Am 14.03.2008 um 15:25 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Thanks, I'll take a look at this. But I'll be a few days though... Sure, no problem. Btw, do you use a rtl locale for the gui? I mean maybe your Qt does some RTL magic which mine does not. Just an idea... I'll keep this possibility in mind, thanks... Stefan
Re: Text completion not working in tables?
Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Stefan
Re: Text completion not working in tables?
Am 14.03.2008 um 15:26 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... AFAIK it only uses the Text class for every cell. Otherwise the cursor would need another slice for the table and the InsetText, and hence many special handling to avoid strange positions which are in the table, but not in the InsetText. Stefan
Re: Text completion and RTL
Am 14.03.2008 um 15:05 schrieb Dov Feldstern: Hi! There's a small problem with the text completion and RTL text: The grayed-out inline completion appears backwards in RTL text (see attached image). I can explain why it is happening (and why this problem wasn't observed when RTL was tested with latin characters), but I don't know how to easily solve the issue. The reason is something like this: when painting text, LyX applies the bidi algorithm, so that the string that it ultimately passes to Qt for painting is already in visual order; however, Qt 4 now applies its own bidi algorithm to all strings that it paints, and it doesn't seem to provide any API for saying "the string is already in visual order, just paint it as it is". To get around this problem, we paint RTL strings one character at a time (see http://www.lyx.org/trac/browser/lyx-devel/trunk/src/rowpainter.cpp?rev=23522#L259) . But I imagine that the grayed-out inline completion is painted as a full string... I haven't looked at the completion code at all, so I'm not sure exactly what's going on; but I'm pretty sure that this is the correct explanation of the problem. Any ideas on what can be done to solve it? I have to check my code as well. The idea was to reverse the string if needed before telling Qt about. But maybe I got something wrong in this logic. Take a look at RowPainter::paintInlineCompletion. That's the code for the text mode. It's a bit more involved than you might expect, because the inline completion consists of the unique part (drawn in dark grey) and the non-unique part (drawn in light grey). I do a reversal of the rtl text there. No idea why it does not work. Or maybe Qt its own bidi magic? Stefan
Re: Text completion not working in tables?
On Fri, Mar 14, 2008 at 03:19:32PM +0100, Stefan Schimanski wrote: > > Am 14.03.2008 um 14:14 schrieb Dov Feldstern: > >> Hi! >> >> Stefan --- the completion stuff looks really, really nice. Thanks! >> >> It seems to me that text completion is not working in tables. Math >> completion *does* work, though. Can anything be done about this? > > It can. But at the moment the support is only in InsetMathNest and > InsetText. Have to try it for InsetTabular. Probably one can just copy the > code from InsetText. Or move it to Text, which is shared by InsetText and InsetTabular? Andre'
Re: Text completion not working in tables?
Am 14.03.2008 um 20:13 schrieb Andre Poenitz: On Fri, Mar 14, 2008 at 03:19:32PM +0100, Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Or move it to Text, which is shared by InsetText and InsetTabular? Will try that. Stefan
Re: Text completion not working in tables?
Stefan Schimanski wrote: Am 14.03.2008 um 15:26 schrieb Dov Feldstern: Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: Hi! Stefan --- the completion stuff looks really, really nice. Thanks! It seems to me that text completion is not working in tables. Math completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. Is the text inside a table cell not an InsetText? I sort of assumed that every cell contains an InsetText for its text... AFAIK it only uses the Text class for every cell. Otherwise the cursor would need another slice for the table and the InsetText, and hence many special handling to avoid strange positions which are in the table, but not in the InsetText. I don't think this is a good thing personally. Cells should be insets. I am pretty sure the code will be less complicated if that was the case. Abdel.
Re: Text completion not working in tables?
On Fri, Mar 14, 2008 at 11:15:48PM +0100, Abdelrazak Younes wrote: > Stefan Schimanski wrote: >> Am 14.03.2008 um 15:26 schrieb Dov Feldstern: >>> Stefan Schimanski wrote: Am 14.03.2008 um 14:14 schrieb Dov Feldstern: > Hi! > > Stefan --- the completion stuff looks really, really nice. Thanks! > > It seems to me that text completion is not working in tables. Math > completion *does* work, though. Can anything be done about this? It can. But at the moment the support is only in InsetMathNest and InsetText. Have to try it for InsetTabular. Probably one can just copy the code from InsetText. >>> >>> Is the text inside a table cell not an InsetText? I sort of assumed that >>> every cell contains an InsetText for its text... >> AFAIK it only uses the Text class for every cell. Otherwise the cursor >> would need another slice for the table and the InsetText, and hence many >> special handling to avoid strange positions which are in the table, but >> not in the InsetText. > > I don't think this is a good thing personally. Cells should be insets. I am > pretty sure the code will be less complicated if that was the case. I always thought a bit like Text == Model, InsetText == View. But of course, the metrics stuff completely defeats this... Andre'