Skip to content

Commit

Permalink
fix(settings): issue with icon in title when switching emoji style (#466
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FlorianWoelki committed May 9, 2024
1 parent 98b49ba commit 6863c4b
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions src/settings/ui/emojiStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,31 @@ export default class EmojiStyleSetting extends IconFolderSetting {

if (emoji.isEmoji(iconName)) {
dom.createIconNode(this.plugin, path, iconName);
const tabLeaves = iconTabs.getTabLeavesOfFilePath(this.plugin, path);
for (const tabLeaf of tabLeaves) {
iconTabs.update(
if (this.plugin.getSettings().iconInTabsEnabled) {
const tabLeaves = iconTabs.getTabLeavesOfFilePath(
this.plugin,
iconName,
tabLeaf.tabHeaderInnerIconEl,
path,
);
for (const tabLeaf of tabLeaves) {
iconTabs.update(
this.plugin,
iconName,
tabLeaf.tabHeaderInnerIconEl,
);
}
}

for (const openedFile of getAllOpenedFiles(this.plugin)) {
const activeView = openedFile.leaf.view as InlineTitleView;
if (
activeView instanceof MarkdownView &&
openedFile.path === path
) {
titleIcon.add(this.plugin, activeView.inlineTitleEl, iconName, {
fontSize: calculateInlineTitleSize(),
});
if (this.plugin.getSettings().iconInTitleEnabled) {
for (const openedFile of getAllOpenedFiles(this.plugin)) {
const activeView = openedFile.leaf.view as InlineTitleView;
if (
activeView instanceof MarkdownView &&
openedFile.path === path
) {
titleIcon.add(this.plugin, activeView.inlineTitleEl, iconName, {
fontSize: calculateInlineTitleSize(),
});
}
}
}
}
Expand Down

0 comments on commit 6863c4b

Please sign in to comment.