mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Revert "Display bookmarks in the workarea."
This will be replaced by a different version.
This reverts commit 99e636ae7b
.
This commit is contained in:
parent
946d112ee6
commit
e4ab91d802
@ -1472,7 +1472,6 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
break;
|
||||
|
||||
case LFUN_BOOKMARK_SAVE:
|
||||
dr.screenUpdate(Update::Force);
|
||||
saveBookmark(convert<unsigned int>(to_utf8(cmd.argument())));
|
||||
break;
|
||||
|
||||
|
@ -341,9 +341,8 @@ ColorSet::ColorSet()
|
||||
{ Color_buttonhoverbg, N_("button background under focus"), "buttonhoverbg", "#C7C7CA", "#C7C7CA", "buttonhoverbg" },
|
||||
{ Color_paragraphmarker, N_("paragraph marker"), "paragraphmarker", grey80, grey40, "paragraphmarker"},
|
||||
{ Color_previewframe, N_("preview frame"), "previewframe", black, Linen, "previewframe"},
|
||||
{ Color_regexpframe, N_("regexp frame"), "regexpframe", Green, green, "regexpframe" },
|
||||
{ Color_bookmark, N_("bookmark"), "bookmark", RoyalBlue, RoyalBlue, "bookmark" },
|
||||
{ Color_inherit, N_("inherit"), "inherit", black, Linen, "inherit" },
|
||||
{ Color_regexpframe, N_("regexp frame"), "regexpframe", Green, green, "regexpframe" },
|
||||
{ Color_ignore, N_("ignore"), "ignore", black, Linen, "ignore" },
|
||||
{ Color_ignore, nullptr, nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
@ -228,8 +228,6 @@ enum ColorCode {
|
||||
Color_paragraphmarker,
|
||||
/// Preview frame color
|
||||
Color_previewframe,
|
||||
/// Bookmark indicator color
|
||||
Color_bookmark,
|
||||
|
||||
// Logical attributes
|
||||
|
||||
|
@ -339,20 +339,6 @@ BookmarksSection::Bookmark const & BookmarksSection::bookmark(unsigned int i) co
|
||||
}
|
||||
|
||||
|
||||
BookmarksSection::BookmarkPosList
|
||||
BookmarksSection::bookmarksInPar(FileName const & fn, int const par_id) const
|
||||
{
|
||||
// FIXME: we do not consider the case of bottom_pit.
|
||||
// This is probably not a problem.
|
||||
BookmarksSection::BookmarkPosList bip;
|
||||
for (size_t i = 1; i < bookmarks.size(); ++i)
|
||||
if (bookmarks[i].filename == fn && bookmarks[i].top_id == par_id)
|
||||
bip.push_back({i, bookmarks[i].top_pos});
|
||||
|
||||
return bip;
|
||||
}
|
||||
|
||||
|
||||
LastCommandsSection::LastCommandsSection(unsigned int num) :
|
||||
default_num_last_commands(30),
|
||||
absolute_max_last_commands(100)
|
||||
|
@ -262,12 +262,6 @@ public:
|
||||
*/
|
||||
BookmarkList & load() { return bookmarks; }
|
||||
|
||||
///
|
||||
typedef std::vector<std::pair<unsigned int, pos_type>> BookmarkPosList;
|
||||
|
||||
/// return a list of bookmarks and position for this paragraph
|
||||
BookmarkPosList bookmarksInPar(support::FileName const & fn, int par_id) const;
|
||||
|
||||
private:
|
||||
|
||||
/// allow 9 regular bookmarks, bookmark 0 is temporary
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "MetricsInfo.h"
|
||||
#include "ParagraphParameters.h"
|
||||
#include "RowPainter.h"
|
||||
#include "Session.h"
|
||||
#include "Text.h"
|
||||
#include "TextClass.h"
|
||||
#include "VSpace.h"
|
||||
@ -880,10 +879,6 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
|
||||
{
|
||||
LATTEST(row.empty());
|
||||
Paragraph const & par = text_->getPar(row.pit());
|
||||
Buffer const & buf = text_->inset().buffer();
|
||||
BookmarksSection::BookmarkPosList bpl =
|
||||
theSession().bookmarks().bookmarksInPar(buf.fileName(), par.id());
|
||||
|
||||
pos_type const end = par.size();
|
||||
pos_type const pos = row.pos();
|
||||
pos_type const body_pos = par.beginOfBody();
|
||||
@ -910,23 +905,7 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
|
||||
// or the end of the par, then build a representation of the row.
|
||||
pos_type i = pos;
|
||||
FontIterator fi = FontIterator(*this, par, row.pit(), pos);
|
||||
// The real stopping condition is a few lines below.
|
||||
while (true) {
|
||||
// Firstly, check whether there is a bookmark here.
|
||||
for (auto const & bp_p : bpl)
|
||||
if (bp_p.second == i) {
|
||||
Font f = *fi;
|
||||
f.fontInfo().setColor(Color_bookmark);
|
||||
// ❶ U+2776 DINGBAT NEGATIVE CIRCLED DIGIT ONE
|
||||
char_type const ch = 0x2775 + bp_p.first;
|
||||
row.addVirtual(i, docstring(1, ch), f, Change());
|
||||
}
|
||||
|
||||
// The stopping condition is here so that the display of a
|
||||
// bookmark can take place at paragraph start too.
|
||||
if (i >= end || (i != pos && row.width() > width))
|
||||
break;
|
||||
|
||||
while (i < end && (i == pos || row.width() <= width)) {
|
||||
char_type c = par.getChar(i);
|
||||
// The most special cases are handled first.
|
||||
if (par.isInset(i)) {
|
||||
@ -1020,7 +999,9 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
|
||||
// in the paragraph.
|
||||
Font f(text_->layoutFont(row.pit()));
|
||||
f.fontInfo().setColor(Color_paragraphmarker);
|
||||
f.setLanguage(par.getParLanguage(buf.params()));
|
||||
BufferParams const & bparams
|
||||
= text_->inset().buffer().params();
|
||||
f.setLanguage(par.getParLanguage(bparams));
|
||||
// ¶ U+00B6 PILCROW SIGN
|
||||
row.addVirtual(end, docstring(1, char_type(0x00B6)), f, change);
|
||||
}
|
||||
|
@ -2192,7 +2192,6 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
|
||||
case LFUN_BOOKMARK_CLEAR:
|
||||
theSession().bookmarks().clear();
|
||||
dr.screenUpdate(Update::Force);
|
||||
break;
|
||||
|
||||
case LFUN_DEBUG_LEVEL_SET:
|
||||
|
Loading…
Reference in New Issue
Block a user