1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Desktop: Resolves #11279: Remove left/right edge margin around editor content when disabled in settings (#11290)

This commit is contained in:
Henry Heino 2024-10-30 14:09:37 -07:00 committed by GitHub
parent f7f4a50d35
commit 2974465882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -378,6 +378,8 @@ const CodeMirror = (props: NoteBodyEditorProps, ref: ForwardedRef<NoteBodyEditor
katexEnabled: Setting.value('markdown.plugin.katex'), katexEnabled: Setting.value('markdown.plugin.katex'),
themeData: { themeData: {
...styles.globalTheme, ...styles.globalTheme,
marginLeft: 0,
marginRight: 0,
monospaceFont: Setting.value('style.editor.monospaceFontFamily'), monospaceFont: Setting.value('style.editor.monospaceFontFamily'),
}, },
automatchBraces: Setting.value('editor.autoMatchingBraces'), automatchBraces: Setting.value('editor.autoMatchingBraces'),

View File

@ -79,6 +79,10 @@ const createTheme = (theme: EditorTheme): Extension[] => {
// be at least this specific. // be at least this specific.
const selectionBackgroundSelector = '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground'; const selectionBackgroundSelector = '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground';
// Matches the editor only when there are no gutters (e.g. line numbers) added by
// plugins
const editorNoGuttersSelector = '&:not(:has(> .cm-scroller > .cm-gutters))';
const baseHeadingStyle = { const baseHeadingStyle = {
fontWeight: 'bold', fontWeight: 'bold',
fontFamily: theme.fontFamily, fontFamily: theme.fontFamily,
@ -180,6 +184,12 @@ const createTheme = (theme: EditorTheme): Extension[] => {
marginRight: 'auto', marginRight: 'auto',
} : undefined, } : undefined,
// Allows editor content to be left-aligned with the toolbar on desktop.
// See https://github.com/laurent22/joplin/issues/11279
[`${editorNoGuttersSelector} .cm-line`]: theme.isDesktop ? {
paddingLeft: 0,
} : undefined,
// Override the default URL style when the URL is within a link // Override the default URL style when the URL is within a link
'& .tok-url.tok-link, & .tok-link.tok-meta, & .tok-link.tok-string': { '& .tok-url.tok-link, & .tok-link.tok-meta, & .tok-link.tok-string': {
opacity: 0.6, opacity: 0.6,