Document no longer has common; Add line styling (#2847)

This commit is contained in:
MinusGix
2023-12-11 15:43:36 -06:00
committed by GitHub
parent e9435735f2
commit 286d2d463d
4 changed files with 542 additions and 402 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
use serde::{Deserialize, Serialize};
use structdesc::FieldNames;
use crate::doc::RenderWhitespace;
pub const SCALE_OR_SIZE_LIMIT: f64 = 5.0;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
@@ -191,7 +193,7 @@ pub struct EditorConfig {
#[field_names(
desc = "How the editor should render whitespace characters.\nOptions: none, all, boundary, trailing."
)]
pub render_whitespace: String,
pub render_whitespace: RenderWhitespace,
#[field_names(desc = "Whether the editor show indent guide.")]
pub show_indent_guide: bool,
#[field_names(
+536 -398
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -374,7 +374,7 @@ pub fn editor_view(
let hide_cursor = editor.common.window_common.hide_cursor;
create_effect(move |_| {
hide_cursor.track();
let occurrences = doc.with(|doc| doc.find_result.occurrences);
let occurrences = doc.with(|doc| doc.backend.find_result.occurrences);
occurrences.track();
id.request_paint();
});
@@ -2681,7 +2681,7 @@ fn find_view(
let editor = editor.get_untracked();
let cursor = editor.cursor;
let offset = cursor.with(|cursor| cursor.offset());
let occurrences = editor.view.doc.get().find_result.occurrences;
let occurrences = editor.view.doc.get().backend.find_result.occurrences;
occurrences.with(|occurrences| {
for (i, region) in occurrences.regions().iter().enumerate() {
if offset <= region.max() {
+1 -1
View File
@@ -294,7 +294,7 @@ impl EditorViewData {
}
pub fn find_result(&self) -> FindResult {
self.doc.get_untracked().find_result.clone()
self.doc.get_untracked().backend.find_result.clone()
}
pub fn update_find(&self) {