1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-30 08:26:59 +02:00

Desktop: Resolves #5364: Disable inline code background in vim mode (#5370)

Also ensure that highlight marks are shown above inline code
This commit is contained in:
Caleb John 2021-08-22 16:34:04 -07:00 committed by GitHub
parent 84d95c6dcb
commit e3bd24f819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -381,6 +381,9 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
`.CodeMirror-selected {
background: #6b6b6b !important;
}` : '';
// Vim mode draws a fat cursor in the background, we don't want to add background colors
// to the inline code in this case (it would hide the cursor)
const codeBackgroundColor = Setting.value('editor.keyboardMode') !== 'vim' ? theme.codeBackgroundColor : 'inherit';
const monospaceFonts = [];
if (Setting.value('style.editor.monospaceFontFamily')) monospaceFonts.push(`"${Setting.value('style.editor.monospaceFontFamily')}"`);
monospaceFonts.push('monospace');
@ -476,9 +479,9 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
}
/* Negative margins are needed to componsate for the border */
div.CodeMirror span.cm-comment.cm-jn-inline-code {
div.CodeMirror span.cm-comment.cm-jn-inline-code:not(.cm-search-marker):not(.cm-fat-cursor-mark):not(.cm-search-marker-selected):not(.CodeMirror-selectedtext) {
border: 1px solid ${theme.codeBorderColor};
background-color: ${theme.codeBackgroundColor};
background-color: ${codeBackgroundColor};
margin-left: -1px;
margin-right: -1px;
border-radius: .25em;