Skip to content

Commit 5940c38

Browse files
fcouryclaude
andcommitted
fix: remove unused method and fix clippy warning
- Removed unused coord_to_pos method from Buffer - Fixed clippy warning about unnecessary reference in line_display_width 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8a1f5c3 commit 5940c38

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/buffer.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -601,18 +601,6 @@ impl Buffer {
601601
self.dirty
602602
}
603603

604-
// Helper method to convert (x,y) coordinates to byte index
605-
// Note: x is a character index, not a display column
606-
fn coord_to_pos(&self, x: usize, y: usize) -> usize {
607-
if y >= self.content.len_lines() {
608-
return self.content.len_bytes();
609-
}
610-
let line_start = self.content.line_to_byte(y);
611-
let line = self.content.line(y);
612-
let x = std::cmp::min(x, line.len_chars());
613-
line_start + line.char_to_byte(x)
614-
}
615-
616604
// Helper method to convert (x,y) coordinates to character index in the rope
617605
fn xy_to_char_idx(&self, x: usize, y: usize) -> usize {
618606
if y >= self.content.len_lines() {
@@ -629,7 +617,7 @@ impl Buffer {
629617
/// Get the display width of a line
630618
pub fn line_display_width(&self, y: usize) -> usize {
631619
if let Some(line) = self.get(y) {
632-
display_width(&line.trim_end_matches('\n'))
620+
display_width(line.trim_end_matches('\n'))
633621
} else {
634622
0
635623
}

0 commit comments

Comments
 (0)