You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
Features: - Scroll position is preserved when the editor layout changes. - Scroll position is remembered when a note selection changes. Modifications: - The current Sync Scroll feature (in v2.6.2) is modified to use line-percent-based scroll positions. - Scroll position translation functions, Viewer-to-Editor and Editor-to-Viewer, are separated into V2L / L2E and E2L / L2V respectively. - The scrollmap is moved from gui/utils/SyncScrollMap.ts to note-viewer/scrollmap.js. - IPC Protocol about the scrollmap becomes not necessary and is removed. - Ignores non-user scroll events to avoid sync with incorrect scroll positions. - When CodeMirror is not ready, setEditorPercentScroll() is waited. - Fixes the bug: An incorrect scroll position is sometimes recorded. - Since scroll positions become line-percent-based, the following incompatibilities of scroll positions are fixed: - Between Editor and Viewer. - Between Viewer Layout and Split Layout of Viewer - Between Editor Layout and Split Layout of Editor
This commit is contained in:
committed by
GitHub
parent
a4aa40dde8
commit
5c82e439a7
@@ -2,7 +2,6 @@ import PostMessageService, { MessageResponse, ResponderComponentType } from '@jo
|
||||
import * as React from 'react';
|
||||
const { connect } = require('react-redux');
|
||||
import { reg } from '@joplin/lib/registry';
|
||||
import { SyncScrollMap, SyncScrollMapper } from './utils/SyncScrollMap';
|
||||
|
||||
interface Props {
|
||||
onDomReady: Function;
|
||||
@@ -168,17 +167,6 @@ class NoteTextViewerComponent extends React.Component<Props, any> {
|
||||
}
|
||||
}
|
||||
|
||||
private syncScrollMapper_ = new SyncScrollMapper;
|
||||
|
||||
refreshSyncScrollMap(forced: boolean) {
|
||||
return this.syncScrollMapper_.refresh(forced);
|
||||
}
|
||||
|
||||
getSyncScrollMap(): SyncScrollMap {
|
||||
const doc = this.webviewRef_.current?.contentWindow?.document;
|
||||
return this.syncScrollMapper_.get(doc);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// Wrap WebView functions (END)
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user