Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gasparschott committed Mar 23, 2024
1 parent d29601b commit 7ec31ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class ContinuousModePlugin extends obsidian.Plugin {
if ( getActiveLeaf().containerEl.closest('.workspace-split.mod-root') === null && !getActiveEditor()?.hasFocus() ) { return; } // return if not in leaf editor or editor not focussed
let cursorAnchor = getActiveEditor()?.getCursor('anchor');
let activeTabGroupChildren = getActiveLeaf().workspace.activeTabGroup.children;
console.log(this.app.workspace.getLeavesOfType('file-explorer')[0].view.fileItems);
switch(e.key) {
case 'ArrowUp': case 'ArrowLeft':
switch(true) {
Expand Down Expand Up @@ -250,7 +249,7 @@ console.log(this.app.workspace.getLeavesOfType('file-explorer')[0].view.fileItem
item2.setTitle('Toggle Continuous Mode')
.setChecked( getTabGroupById(tab_group_id).containerEl.classList.contains('is_continuous_mode') ? true : false )
.onClick(async () => {
toggleContinuousMode(tab_group_id);
toggleContinuousMode(tab_group_id || this.app.appId+'_'+getActiveTabGroup().id);
})
})
.addItem((item3) => {
Expand Down Expand Up @@ -311,9 +310,10 @@ console.log(this.app.workspace.getLeavesOfType('file-explorer')[0].view.fileItem
);
this.registerEvent( // initContinuousMode on layout change
this.app.workspace.on('layout-change', async () => {
// updateTabGroupDatasetIds();
// cleanDataTabGroupIds(); // disabled
// initContinuousMode();
updateTabGroupDatasetIds();
cleanDataTabGroupIds(); // disabled
initContinuousMode();
scrollActiveLeafIntoView();
})
);
this.app.workspace.onLayoutReady( async () => { // initContinuousMode on layout ready
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "continuous-mode",
"name": "Continuous Mode",
"version": "1.2.1",
"version": "1.2.2",
"minAppVersion": "0.15.0",
"description": "Displays all open notes in a tab group as if they were a continuous scrollable document (sometimes called \"Scrivenings mode\"). Features include arrow navigation between notes and the ability to reorder notes via tab header drag-and-drop.",
"author": "Michael Schrauzer",
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
.workspace-tabs.is_continuous_mode:not(.mod-stacked) .markdown-preview-view img:not([width]),
.markdown-rendered img:not([width])
{
max-width:calc(100% - 2*var(--file-margins));
/* max-width:calc(100% - 2*var(--file-margins)); */
}
/* pdf note styles */
.workspace-tabs.is_continuous_mode:not(.mod-stacked) .workspace-leaf-content[data-type="pdf"] .view-content
Expand Down

0 comments on commit 7ec31ac

Please sign in to comment.