Browse Source

Merge pull request #6556 from telamonian/fix-codemirror-multiline-select

fixes #6439: underhang in highlighting of multiline selections
Jason Grout 5 years ago
parent
commit
ec5fd3c4d8

+ 3 - 8
packages/codemirror/style/base.css

@@ -7,14 +7,14 @@
   line-height: var(--jp-code-line-height);
   font-size: var(--jp-code-font-size);
   font-family: var(--jp-code-font-family);
+  border: 0;
+  border-radius: 0;
   height: auto;
   /* Changed to auto to autogrow */
 }
 
 .CodeMirror pre {
-  padding: 0;
-  border: 0;
-  border-radius: 0;
+  padding: 0 var(--jp-code-padding);
 }
 
 .jp-CodeMirrorEditor[data-type='inline'] .CodeMirror-dialog {
@@ -28,11 +28,6 @@
   padding: var(--jp-code-padding) 0;
 }
 
-/* Set horizontal padding on line nodes for correct margins */
-pre.CodeMirror-line {
-  padding: 0 var(--jp-code-padding);
-}
-
 .CodeMirror-linenumber {
   padding: 0 8px;
 }

+ 1 - 1
packages/theme-dark-extension/style/variables.css

@@ -181,7 +181,7 @@ all of MD as it is not optimized for dense, information rich UIs.
 
   --jp-code-font-size: 13px;
   --jp-code-line-height: 1.3077; /* 17px for 13px base */
-  --jp-code-padding: 0.385em; /* 5px for 13px base */
+  --jp-code-padding: 5px; /* 5px for 13px base, codemirror highlighting needs integer px value */
   --jp-code-font-family-default: Menlo, Consolas, 'DejaVu Sans Mono', monospace;
   --jp-code-font-family: var(--jp-code-font-family-default);
 

+ 1 - 1
packages/theme-light-extension/style/variables.css

@@ -179,7 +179,7 @@ all of MD as it is not optimized for dense, information rich UIs.
 
   --jp-code-font-size: 13px;
   --jp-code-line-height: 1.3077; /* 17px for 13px base */
-  --jp-code-padding: 0.385em; /* 5px for 13px base */
+  --jp-code-padding: 5px; /* 5px for 13px base, codemirror highlighting needs integer px value */
   --jp-code-font-family-default: Menlo, Consolas, 'DejaVu Sans Mono', monospace;
   --jp-code-font-family: var(--jp-code-font-family-default);