Start work on allowing blocks to be styled
This commit is contained in:
parent
c04151f999
commit
8d1a4a6a24
7 changed files with 232 additions and 96 deletions
|
@ -13,7 +13,7 @@ use language::{Anchor, Buffer, Point, ToOffset, ToPoint};
|
|||
use std::{collections::HashSet, ops::Range};
|
||||
use sum_tree::Bias;
|
||||
use tab_map::TabMap;
|
||||
use theme::SyntaxTheme;
|
||||
use theme::{BlockStyle, SyntaxTheme};
|
||||
use wrap_map::WrapMap;
|
||||
|
||||
pub trait ToDisplayPoint {
|
||||
|
@ -172,8 +172,8 @@ impl DisplayMapSnapshot {
|
|||
self.buffer_snapshot.len() == 0
|
||||
}
|
||||
|
||||
pub fn buffer_rows(&self, start_row: u32) -> BufferRows {
|
||||
self.blocks_snapshot.buffer_rows(start_row)
|
||||
pub fn buffer_rows<'a>(&'a self, start_row: u32, cx: Option<&'a AppContext>) -> BufferRows<'a> {
|
||||
self.blocks_snapshot.buffer_rows(start_row, cx)
|
||||
}
|
||||
|
||||
pub fn buffer_row_count(&self) -> u32 {
|
||||
|
@ -416,6 +416,13 @@ impl ToDisplayPoint for Anchor {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum DisplayRow {
|
||||
Buffer(u32),
|
||||
Block(BlockId, Option<BlockStyle>),
|
||||
Wrap,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue