MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / test_ensure_cursor_visible

Function test_ensure_cursor_visible

src/text_input.rs:3305–3316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3303
3304 #[test]
3305 fn test_ensure_cursor_visible() {
3306 let mut state = TextEditState::default();
3307 state.scroll_offset = 0.0;
3308
3309 // Cursor at x=150, visible_width=100 → should scroll right
3310 state.ensure_cursor_visible(150.0, 100.0);
3311 assert_eq!(state.scroll_offset, 50.0);
3312
3313 // Cursor at x=30, scroll_offset=50 → 30-50 = -20 < 0 → scroll left
3314 state.ensure_cursor_visible(30.0, 100.0);
3315 assert_eq!(state.scroll_offset, 30.0);
3316 }
3317
3318 #[test]
3319 fn test_backspace_word() {

Callers

nothing calls this directly

Calls 1

ensure_cursor_visibleMethod · 0.80

Tested by

no test coverage detected