55//! The anchor_line (file line number) is stable across filter changes.
66
77/// Result of resolving the viewport against current content
8- #[ allow( dead_code) ]
98#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
109pub struct ResolvedView {
1110 /// Index into line_indices for the selected line
@@ -15,7 +14,6 @@ pub struct ResolvedView {
1514}
1615
1716/// Viewport manages selection and scrolling with vim-like behavior
18- #[ allow( dead_code) ]
1917#[ derive( Debug , Clone ) ]
2018pub struct Viewport {
2119 /// The file line number that is selected (stable across filter changes)
@@ -34,7 +32,6 @@ pub struct Viewport {
3432 cache : Option < ResolvedView > ,
3533}
3634
37- #[ allow( dead_code) ]
3835impl Viewport {
3936 /// Create a new viewport anchored to the given line
4037 pub fn new ( initial_line : usize ) -> Self {
@@ -150,6 +147,7 @@ impl Viewport {
150147
151148 /// Move viewport by delta lines without moving selection
152149 /// (selection stays on same line, but moves on screen)
150+ #[ allow( dead_code) ] // Future: Ctrl+E/Ctrl+Y vim commands
153151 pub fn move_viewport ( & mut self , delta : i32 , line_indices : & [ usize ] ) {
154152 if line_indices. is_empty ( ) || self . height == 0 {
155153 return ;
@@ -244,6 +242,7 @@ impl Viewport {
244242 }
245243
246244 /// Jump to a specific index in the current view
245+ #[ allow( dead_code) ] // Future: direct index jumping
247246 pub fn jump_to_index ( & mut self , index : usize , line_indices : & [ usize ] ) {
248247 if line_indices. is_empty ( ) {
249248 return ;
@@ -344,21 +343,25 @@ impl Viewport {
344343 }
345344
346345 /// Get the cached selected index (call resolve() first)
346+ #[ allow( dead_code) ] // Public API for future use
347347 pub fn selected_index ( & self ) -> usize {
348348 self . cache . map ( |c| c. selected_index ) . unwrap_or ( 0 )
349349 }
350350
351351 /// Get the cached scroll position (call resolve() first)
352+ #[ allow( dead_code) ] // Public API for future use
352353 pub fn scroll_position ( & self ) -> usize {
353354 self . cache . map ( |c| c. scroll_position ) . unwrap_or ( 0 )
354355 }
355356
356357 /// Get current height
358+ #[ allow( dead_code) ] // Public API for future use
357359 pub fn height ( & self ) -> usize {
358360 self . height
359361 }
360362
361363 /// Set height (usually called during resolve, but can be set explicitly)
364+ #[ allow( dead_code) ] // Public API for future use
362365 pub fn set_height ( & mut self , height : usize ) {
363366 if self . height != height {
364367 self . height = height;
0 commit comments