fix(editor): hide UTF-8 BOM and lighten replace buttons
This commit is contained in:
@@ -448,8 +448,8 @@ body.edit-finding #edit-findbar { display: flex; flex-direction: column; align-i
|
|||||||
#edit-findbar .edit-replace-row { display: flex; align-items: center; gap: 6px; width: 100%; border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; }
|
#edit-findbar .edit-replace-row { display: flex; align-items: center; gap: 6px; width: 100%; border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; }
|
||||||
#edit-findbar .edit-replace-row[hidden] { display: none; }
|
#edit-findbar .edit-replace-row[hidden] { display: none; }
|
||||||
#edit-findbar #edit-replace-input { flex: 1 1 auto; width: auto; min-width: 0; }
|
#edit-findbar #edit-replace-input { flex: 1 1 auto; width: auto; min-width: 0; }
|
||||||
#edit-findbar button.edit-replace-btn { width: auto; height: 28px; min-width: 64px; padding: 0 10px; border: 1px solid #e6e6e6; border-radius: 7px; background: #ebebeb; color: #333; font-size: 12px; }
|
#edit-findbar button.edit-replace-btn { width: auto; height: 28px; min-width: 64px; padding: 0 10px; border: 1px solid #e6e6e6; border-radius: 7px; background: #f5f5f5; color: #333; font-size: 12px; }
|
||||||
#edit-findbar button.edit-replace-btn:hover { background: #e0e0e0; color: #111; }
|
#edit-findbar button.edit-replace-btn:hover { background: #ededed; color: #111; }
|
||||||
#cm-editor .cm-edit-find-hit { background: rgba(255, 213, 0, .38); }
|
#cm-editor .cm-edit-find-hit { background: rgba(255, 213, 0, .38); }
|
||||||
|
|
||||||
/* Use the same thin scrollbar inside CodeMirror as the preview container. */
|
/* Use the same thin scrollbar inside CodeMirror as the preview container. */
|
||||||
|
|||||||
@@ -708,6 +708,9 @@
|
|||||||
indentUnit: 2,
|
indentUnit: 2,
|
||||||
tabSize: 2,
|
tabSize: 2,
|
||||||
indentWithTabs: false,
|
indentWithTabs: false,
|
||||||
|
// Keep the file's UTF-8 BOM invisible: CM otherwise draws it as a
|
||||||
|
// red special-character dot. The value still round-trips on save.
|
||||||
|
specialChars: /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufff9-\ufffc]/g,
|
||||||
viewportMargin: 10,
|
viewportMargin: 10,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
'Tab': function(instance) {
|
'Tab': function(instance) {
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ mod tests {
|
|||||||
assert!(page.contains("CM_MAX_BYTES = 2 * 1024 * 1024"));
|
assert!(page.contains("CM_MAX_BYTES = 2 * 1024 * 1024"));
|
||||||
assert!(page.contains("CodeMirror-linenumbers"));
|
assert!(page.contains("CodeMirror-linenumbers"));
|
||||||
assert!(page.contains("rangeFinder: markdownFoldRange"));
|
assert!(page.contains("rangeFinder: markdownFoldRange"));
|
||||||
|
assert!(page.contains("specialChars: /["));
|
||||||
|
assert!(!page.contains("\\ufeff"));
|
||||||
assert!(page.contains("openEditFind(false)"));
|
assert!(page.contains("openEditFind(false)"));
|
||||||
assert!(page.contains("openEditFind(true)"));
|
assert!(page.contains("openEditFind(true)"));
|
||||||
assert!(!page.contains("CodeMirror.defineMode"));
|
assert!(!page.contains("CodeMirror.defineMode"));
|
||||||
|
|||||||
Reference in New Issue
Block a user