Bo Peng wrote:
Attached is a new version with LFUN_BOOKMARK_CLEAR. The bookmarks work
well except that

1. assert error when lyx exits
2. when open a new empty window, bookmark menu works fine but go to
bookmark will fail.

Both problems relate to invalid lyx_view_ (I guess). Since I am not
sure how buffer/view/lyx_view/multi-win interact. Abdel, could you
please have a look at this part:

Yes, I think I've answered you in a previous mail already (mail in copy at the end of this one).


        case LFUN_BOOKMARK_GOTO: {

put an assert here:
+         BOOST_ASSERT(lyx_view_);


Abdel.


Bo Peng wrote:
> Dear all,
>
> Attached patch re-organize the bookmarks feature.
>
> Changes:
>
> 1. change related menu items to
>    save-bookmark 1 (add a bookmark)
>    Bookmarks:  auto-expanded bookmark list
> 2. Bookmarks are saved/handled in session.h/C. saved_positions is
> removed from BufferView.h/C.

Please rename that to moveCursor() instead of restorePosition() as this could be used for something else than the bookmark feature.


> 3. LFUN_BOOKMARK_SAVE stays in BufferView.C

It makes sense yes.


> 4. LFUN_BOOKMARK_GOTO moves to lyxfunc.C. It is available even if
> there is no opened documents.

Good.

>
>
> PROBLEMS (Please help):
>
> 1. a strange bug in MenuBackends. If I change return to break (see
> patch), I will get a TOC after Bookmarks. I am out of idea now.

I think this is because expandFormats() is called recursively or something like that. JMarc will know.


> 2. To keep saved_positions[0], I have to add temp_bookmark in the
> BookmarkSection class. This makes the code ugly but I have no better
> idea. Note that bookmarks is now a deque so I can not use the first
> item as saved_position[0].

Why don't you create a new LFUN for that instead of misusing the bookmark stuff? Then you could also use the (renamed) moveCursor().


> 3. I see Assertion failed: lyx_view_->buffer()->fileName() !=
> bm.filename void lyx::LyXFunc::dispatch(const lyx::FuncRequest&)
> src/lyxfunc.C 1679 when lyx exits. No idea what is going on.

Maybe because lyx_view_ is set to zero when exiting. You have to save the stuff before the effective exiting procedure is started. We can fix that later if you want.

Abdel.



Reply via email to