Code editor: two measure comments fit ten words
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cd61653ff1
commit
4a8f940ea2
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -172,7 +172,7 @@ impl CodeEditor {
|
|||||||
advance,
|
advance,
|
||||||
window,
|
window,
|
||||||
);
|
);
|
||||||
// Text sits where laid out; rulers and guides on the grid.
|
// Text where laid out; rulers and guides on grid.
|
||||||
let x = |column: usize| advance + measured.x(column);
|
let x = |column: usize| advance + measured.x(column);
|
||||||
let grid = |column: usize| advance * (column + 1) as f32;
|
let grid = |column: usize| advance * (column + 1) as f32;
|
||||||
let focused = self.focus.is_focused(window);
|
let focused = self.focus.is_focused(window);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ impl Measured {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The column whose start lies nearest `x`, line end included.
|
/// The column starting nearest `x`, line end included.
|
||||||
pub fn column(&self, x: Pixels) -> usize {
|
pub fn column(&self, x: Pixels) -> usize {
|
||||||
let starts = self.layout.runs.iter().flat_map(|run| {
|
let starts = self.layout.runs.iter().flat_map(|run| {
|
||||||
run.glyphs
|
run.glyphs
|
||||||
|
|||||||
Reference in new issue
Block a user