Editor docs (#4097)

Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
This commit is contained in:
Piotr Osiewicz 2024-01-18 00:48:37 +01:00 committed by GitHub
parent 647b08b101
commit 6cbc49e5f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 507 additions and 376 deletions

View file

@ -1,6 +1,6 @@
pub mod actions;
pub mod autoscroll;
pub mod scroll_amount;
mod actions;
pub(crate) mod autoscroll;
pub(crate) mod scroll_amount;
use crate::{
display_map::{DisplaySnapshot, ToDisplayPoint},
@ -9,8 +9,10 @@ use crate::{
Anchor, DisplayPoint, Editor, EditorEvent, EditorMode, InlayHintRefreshReason,
MultiBufferSnapshot, ToPoint,
};
pub use autoscroll::{Autoscroll, AutoscrollStrategy};
use gpui::{point, px, AppContext, Entity, Pixels, Task, ViewContext};
use language::{Bias, Point};
pub use scroll_amount::ScrollAmount;
use std::{
cmp::Ordering,
time::{Duration, Instant},
@ -18,11 +20,6 @@ use std::{
use util::ResultExt;
use workspace::{ItemId, WorkspaceId};
use self::{
autoscroll::{Autoscroll, AutoscrollStrategy},
scroll_amount::ScrollAmount,
};
pub const SCROLL_EVENT_SEPARATION: Duration = Duration::from_millis(28);
pub const VERTICAL_SCROLL_MARGIN: f32 = 3.;
const SCROLLBAR_SHOW_INTERVAL: Duration = Duration::from_secs(1);