* src/session.C: check validity of temp bookmark
* src/lyxfunc.C: check validity of bookmark in GOTO_BOOKMARK
* lib/bind/*.bind: remove shortcuts to bookmark-save 2/3/4/5
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16589
a592a061-630c-0410-9148-
cb99ea01b6c8
\bind "C-~S-4" "bookmark-goto 4"
\bind "C-~S-5" "bookmark-goto 5"
\bind "C-M-~S-1" "bookmark-save 1"
-\bind "C-M-~S-2" "bookmark-save 2"
-\bind "C-M-~S-3" "bookmark-save 3"
-\bind "C-M-~S-4" "bookmark-save 4"
-\bind "C-M-~S-5" "bookmark-save 5"
#
\bind "C-~S-4" "bookmark-goto 4"
\bind "C-~S-5" "bookmark-goto 5"
\bind "C-M-~S-1" "bookmark-save 1"
-\bind "C-M-~S-2" "bookmark-save 2"
-\bind "C-M-~S-3" "bookmark-save 3"
-\bind "C-M-~S-4" "bookmark-save 4"
-\bind "C-M-~S-5" "bookmark-save 5"
# The below are xemacs bindings
#\bind "Home" "line-begin"
\bind "C-~S-4" "bookmark-goto 4"
\bind "C-~S-5" "bookmark-goto 5"
\bind "C-M-~S-1" "bookmark-save 1"
-\bind "C-M-~S-2" "bookmark-save 2"
-\bind "C-M-~S-3" "bookmark-save 3"
-\bind "C-M-~S-4" "bookmark-save 4"
-\bind "C-M-~S-5" "bookmark-save 5"
#
\bind "C-~S-4" "bookmark-goto 4"
\bind "C-~S-5" "bookmark-goto 5"
\bind "C-M-~S-1" "bookmark-save 1"
-\bind "C-M-~S-2" "bookmark-save 2"
-\bind "C-M-~S-3" "bookmark-save 3"
-\bind "C-M-~S-4" "bookmark-save 4"
-\bind "C-M-~S-5" "bookmark-save 5"
#
# Motion + select group
case LFUN_BOOKMARK_GOTO: {
BOOST_ASSERT(lyx_view_);
unsigned int idx = convert<unsigned int>(to_utf8(cmd.argument()));
+ if (!LyX::ref().session().bookmarks().isValid(idx))
+ break;
BookmarksSection::Bookmark const bm = LyX::ref().session().bookmarks().bookmark(idx);
BOOST_ASSERT(!bm.filename.empty());
string const file = bm.filename.absFilename();
bool BookmarksSection::isValid(unsigned int i) const
{
- // i == 0, or in the queue
- return i <= bookmarks.size();
+ if (i == 0)
+ return !temp_bookmark.filename.empty();
+ else
+ return i <= bookmarks.size() && !bookmarks[i-1].filename.empty();
}