Basic side-by-side diff implementation (#43586)
Release Notes: - N/A --------- Co-authored-by: cameron <cameron.studdstreet@gmail.com> Co-authored-by: Cameron <cameron@zed.dev>
This commit is contained in:
co-authored by
cameron
Cameron
parent
ca6e64d451
commit
2e00f40c54
@@ -36,6 +36,7 @@ mod persistence;
|
||||
mod rust_analyzer_ext;
|
||||
pub mod scroll;
|
||||
mod selections_collection;
|
||||
mod split;
|
||||
pub mod tasks;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -69,6 +70,7 @@ pub use multi_buffer::{
|
||||
MultiBufferOffset, MultiBufferOffsetUtf16, MultiBufferSnapshot, PathKey, RowInfo, ToOffset,
|
||||
ToPoint,
|
||||
};
|
||||
pub use split::SplittableEditor;
|
||||
pub use text::Bias;
|
||||
|
||||
use ::git::{
|
||||
@@ -1198,6 +1200,7 @@ pub struct Editor {
|
||||
applicable_language_settings: HashMap<Option<LanguageName>, LanguageSettings>,
|
||||
accent_overrides: Vec<SharedString>,
|
||||
fetched_tree_sitter_chunks: HashMap<ExcerptId, HashSet<Range<BufferRow>>>,
|
||||
use_base_text_line_numbers: bool,
|
||||
}
|
||||
|
||||
fn debounce_value(debounce_ms: u64) -> Option<Duration> {
|
||||
@@ -1637,7 +1640,7 @@ pub(crate) struct FocusedBlock {
|
||||
focus_handle: WeakFocusHandle,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
enum JumpData {
|
||||
MultiBufferRow {
|
||||
row: MultiBufferRow,
|
||||
@@ -2344,6 +2347,7 @@ impl Editor {
|
||||
applicable_language_settings: HashMap::default(),
|
||||
accent_overrides: Vec::new(),
|
||||
fetched_tree_sitter_chunks: HashMap::default(),
|
||||
use_base_text_line_numbers: false,
|
||||
};
|
||||
|
||||
if is_minimap {
|
||||
@@ -19204,6 +19208,10 @@ impl Editor {
|
||||
self.display_map.read(cx).fold_placeholder.clone()
|
||||
}
|
||||
|
||||
pub fn set_use_base_text_line_numbers(&mut self, show: bool, _cx: &mut Context<Self>) {
|
||||
self.use_base_text_line_numbers = show;
|
||||
}
|
||||
|
||||
pub fn set_expand_all_diff_hunks(&mut self, cx: &mut App) {
|
||||
self.buffer.update(cx, |buffer, cx| {
|
||||
buffer.set_all_diff_hunks_expanded(cx);
|
||||
|
||||
Reference in New Issue
Block a user