Is this the right behavior for del?

2006-04-06 Thread Bo Peng
Dear list, I have fixed 686, a bug I submitted on 2002-10-23, fixed on 2003-01-13 (more than three years ago!), and got messed up by someone else. It should work again with my updated patch. (not uploaded yet.) One problem though, I notice that when the cursor (|) is at the end of an inset [abc|]

Re: Is this the right behavior for del?

2006-04-06 Thread Bo Peng
> One problem though, I notice that when the cursor (|) is at the end of > an inset [abc|], delete key will move the cursor out of the inset > |[abc]. This is a bit strange to me so I would like to ask if this is > the desired behavior. Maybe we should let it work like backspace in > this case? A

Re: Is this the right behavior for del?

2006-04-06 Thread Joost Verburg
Bo Peng wrote: 0. bug 686: del [|] remoes the whole inset, implemented That is the expected behavior, it's a valid bug and should be fixed. 1. del at [abc|] work as backspace (instead of doing nothing) It should do nothing. Working like backspace is non-standard and unexpected behavior

Re: Is this the right behavior for del?

2006-04-06 Thread Bo Peng
> It makes no sense at all to define different behavior for such cases. Is [abcdf|] + del = |[abcd] a sound behavior by your standard? Bo

Re: Is this the right behavior for del?

2006-04-06 Thread Bo Peng
> Is [abcdf|] + del = |[abcd] a sound behavior by your standard? Of course I mean the current behavior [abcd|] + del = |[abcd] . This behavior actually triggered my above ideas. Bo

Re: Is this the right behavior for del?

2006-04-06 Thread Joost Verburg
Bo Peng wrote: Is [abcdf|] + del = |[abcd] a sound behavior by your standard? Of course I mean the current behavior [abcd|] + del = |[abcd] . This behavior actually triggered my above ideas. In my opinion del should do nothing here. Joost

Re: Is this the right behavior for del?

2006-04-06 Thread Bo Peng
> In my opinion del should do nothing here. OK. Let us wait other's opinion and see if we should change the current behavior, which is, in my opinion, worse than acting as backspace, or doing nothing. In the meantime, if you have time, could you help me test the attached patch? It basically resto

Re: Is this the right behavior for del?

2006-04-06 Thread Martin Vermeer
On Thu, Apr 06, 2006 at 05:17:33PM -0500, Bo Peng wrote: > > In my opinion del should do nothing here. > > OK. Let us wait other's opinion and see if we should change the > current behavior, which is, in my opinion, worse than acting as > backspace, or doing nothing. > > In the meantime, if you h

Re: Is this the right behavior for del?

2006-04-06 Thread Helge Hafting
Bo Peng wrote: It makes no sense at all to define different behavior for such cases. Is [abcdf|] + del = |[abcd] a sound behavior by your standard? Not by mine. Here is what I consider normal behaviour for "del": 1. If there is a selection - delete it. Nothing more happens. 2. If no

Re: Is this the right behavior for del?

2006-04-07 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: >> In my opinion del should do nothing here. Bo> OK. Let us wait other's opinion and see if we should change the Bo> current behavior, which is, in my opinion, worse than acting as Bo> backspace, or doing nothing. FWIW, I agree with Joost comments

Re: Is this the right behavior for del?

2006-04-07 Thread Bo Peng
> what pullArg does, is: take the content of a cell, delete the cell, and > re-insert the content in place in the surrounding cell. (Only in > mathed). [Why isn't this as a comment in the code ?!?] I have found this function useless in my cases. In the case of nested cells, this causes [|]

Re: Is this the right behavior for del?

2006-04-07 Thread Martin Vermeer
On Fri, Apr 07, 2006 at 08:31:00AM -0500, Bo Peng wrote: ... > Top level case is easy. My patch 3 years ago did just that, with a > depth() condition that became broken later. ... > Yes. I did try various conditions. To achieve the reported behavior, > the patch is the best I can get so far.

Re: Is this the right behavior for del?

2006-04-07 Thread Bo Peng
> Nevertheless, I came up with a different proposal. It behaves > differently from your patch, but I think it has sane behavior too. And > IMHO looks a little cleaner. I have not applied your patch. Exactly which behavior is different? > What do you think? So, you did everything in pullArg, and

Re: Is this the right behavior for del?

2006-04-07 Thread Bo Peng
> > What do you think? I see the only difference: I move the cursor left in the case of [|] --- [abc] but you don't. My patch is compatible with the current behavior. BTW, lyx just crashes with some combination with del/bs/undo... we need to be more careful here. :-( Bo

Re: Is this the right behavior for del?

2006-04-07 Thread Bo Peng
> What do you think? Can not reproduce the crash now. But 1. enter methed, 2. enter a/b (fraction) 3. put cursor after b 4. bs/bs/bs/bs/bs, b is deleted, and then nothing happens. 5. then undo, undo, undo. ... Note that the rest of your bs does not move the cursor, but affect undo. Bo

Re: Is this the right behavior for del?

2006-04-07 Thread Martin Vermeer
On Fri, Apr 07, 2006 at 05:54:35PM -0500, Bo Peng wrote: > > What do you think? > > Can not reproduce the crash now. But > > 1. enter methed, > 2. enter a/b (fraction) > 3. put cursor after b > 4. bs/bs/bs/bs/bs, b is deleted, and then nothing happens. > 5. then undo, undo, undo. ... > > Note th

Re: Is this the right behavior for del?

2006-04-08 Thread Andre Poenitz
On Thu, Apr 06, 2006 at 04:35:28PM -0500, Bo Peng wrote: > 0. bug 686: del [|] remoes the whole inset, implemented Ok. > 1. del at [abc|] work as backspace (instead of doing nothing) No, should melt the inset's content into the surrounding ite, > 2. backspace/del at [ [a] [|] [ ] ] moves

Re: Is this the right behavior for del?

2006-04-08 Thread Bo Peng
> Does your patch behave differently in that respect? No. A newer version is trying to reverse empty undo, but it seems that I have complicated the problem too much. Bo

Re: Is this the right behavior for del?

2006-04-08 Thread Bo Peng
> > > 1. del at [abc|] work as backspace (instead of doing nothing) > > No, should melt the inset's content into the surrounding ite, What exact do you mean? It sounds dangerous and difficult to 'melt the content'. > > 2. backspace/del at [ [a] [|] [ ] ] moves to the end of first cell > > O

Re: Is this the right behavior for del?

2006-04-08 Thread Martin Vermeer
On Fri, Apr 07, 2006 at 04:59:37PM -0500, Bo Peng wrote: > > > What do you think? > > I see the only difference: I move the cursor left in the case of > > [|] > --- > [abc] > > but you don't. My patch is compatible with the current behavior. Ah yes. Actually nothing happening when you press a k

Re: Is this the right behavior for del?

2006-04-08 Thread Georg Baum
Am Samstag, 8. April 2006 17:19 schrieb Bo Peng: > > > > > 1. del at [abc|] work as backspace (instead of doing nothing) > > > > No, should melt the inset's content into the surrounding ite, > > What exact do you mean? It sounds dangerous and difficult to 'melt the content'. This is something

Re: Is this the right behavior for del?

2006-04-08 Thread Bo Peng
> Attached my next attempt. Now, pullArg is used at some other places (font something?) Are you sure your pullArg will work over there? Bo

Re: Is this the right behavior for del?

2006-04-08 Thread Martin Vermeer
On Sat, Apr 08, 2006 at 03:27:44PM -0500, Bo Peng wrote: > > Attached my next attempt. Now, > > pullArg is used at some other places (font something?) Are you sure > your pullArg will work over there? I tried with fontinsets in math, i.e., \textrm. Seems to work. (And looking at the code, I suspe

Re: Is this the right behavior for del?

2006-04-09 Thread Andre Poenitz
On Sat, Apr 08, 2006 at 10:28:45PM +0300, Martin Vermeer wrote: > Is there a way to store a true MathArray into the Undo object? Not yet. However, the next person approaching 'undo' should try to get the fundamentals right: It is ridiculous to store a whole paragraph if only a single character ch

Re: Is this the right behavior for del?

2006-04-09 Thread Andre Poenitz
On Sat, Apr 08, 2006 at 10:19:40AM -0500, Bo Peng wrote: > > > > > 1. del at [abc|] work as backspace (instead of doing nothing) > > > > No, should melt the inset's content into the surrounding ite, > > What exact do you mean? It sounds dangerous and difficult to 'melt the > content'. 'Del' a

Re: Is this the right behavior for del?

2006-04-09 Thread Georg Baum
Am Samstag, 8. April 2006 21:28 schrieb Martin Vermeer: > Undo is a snake nest... one of the snakes being the pair of methods > > std::string asString(MathArray const & ar); > void asArray(std::string const & str, MathArray & ar); > > found in math_support. These convert a math array

Re: Is this the right behavior for del?

2006-04-09 Thread Martin Vermeer
On Sun, Apr 09, 2006 at 09:25:48AM +0200, Andre Poenitz wrote: > On Sat, Apr 08, 2006 at 10:19:40AM -0500, Bo Peng wrote: ... > Have a look at what math does. I think it deletes a sequence of empty > cells if that keeps the geometry. I.e. in > > [x] [|] [] > [] [y] [z] > > will yield > >

Re: Is this the right behavior for del?

2006-04-09 Thread Martin Vermeer
On Sun, Apr 09, 2006 at 10:16:24AM +0200, Georg Baum wrote: > Am Samstag, 8. April 2006 21:28 schrieb Martin Vermeer: > > Undo is a snake nest... one of the snakes being the pair of methods > > > > std::string asString(MathArray const & ar); > > void asArray(std::string const & str, MathAr