Hi JMarc Jean-Marc Lasgouttes wrote:
> Going left from bv->cursor() does not make sense at all, but > unfortunaltey we need to have a LCursor to pass, and originally 'from' > is just a slice. Therefore I decided to change the code to use LCursor > all over. Note that all the users of getWord do have a LCursor to > operate on, but they only passed a slice of that. > > Alfredo> I'd use DocIterator instead of LCursor if you just need it > Alfredo> only for positioning (and do not need the selection/dispatch > Alfredo> part). > > But, cursorLeftOneWord requires a word, doesn't it? I don't quite get the sense in that phrase. Do you meant "LCursor" intead of "word" ? > An alternative way of doing it would be not to use cursorLeftOneWord > at all, but do the move to the left 'by hand'. Would you prefer that? Ah, I see (if the above is true). I think that probably the cleanest way would be to have the word "identifier" functions to operate at the slice level, and have cursorLeftOneWord and getWord to to use them independently (and build/modify the appropriate deep cursor). But of course, it may me just a matter of taste. I'd apply what you have and leave the "political" bussiness for later. One think I don't like so much in the current way of going is that some LyXText methods use deep cursors but just operate on a slice they "own", and this is pretty much error prone. It may make sense at some point to have LyXText methods to just use slices, and move all "deep" methods out of LyXText (lyxtext_funcs again or else). I think that the thing needs some discussion. Hopefully on the LDM? Alfredo