mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 01:48:28 +00:00
Prepare to support nested operations
This commit is contained in:
parent
ec6b444ec9
commit
97ce9f88ac
@ -78,7 +78,7 @@ impl TextRenderer {
|
||||
},
|
||||
);
|
||||
|
||||
for (op, selected) in operations.operations().into_iter() {
|
||||
for (op, selected, indent) in operations.operations().into_iter() {
|
||||
let mut attrs = glyphon::Attrs::new();
|
||||
|
||||
if selected {
|
||||
@ -86,6 +86,11 @@ impl TextRenderer {
|
||||
}
|
||||
|
||||
let mut line = String::new();
|
||||
|
||||
for _ in 0..indent {
|
||||
write!(line, "\t")?;
|
||||
}
|
||||
|
||||
write!(line, "{op}")?;
|
||||
|
||||
buffer.lines.push(glyphon::BufferLine::new(
|
||||
|
@ -16,7 +16,7 @@ impl OperationView {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn operations(&self) -> Vec<(Self, bool)> {
|
||||
pub fn operations(&self) -> Vec<(Self, bool, usize)> {
|
||||
self.operation
|
||||
.children()
|
||||
.into_iter()
|
||||
@ -28,6 +28,7 @@ impl OperationView {
|
||||
selected: None,
|
||||
},
|
||||
Some(i) == self.selected,
|
||||
0,
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
@ -55,7 +56,7 @@ impl OperationView {
|
||||
self.operations()
|
||||
.into_iter()
|
||||
.nth(selected)
|
||||
.map(|(op, _)| op)
|
||||
.map(|(op, _, _)| op)
|
||||
})
|
||||
.unwrap_or(self.clone())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user