MCPcopy Index your code
hub / github.com/endbasic/endbasic / yx

Function yx

repl/src/editor.rs:570–572  ·  view source on GitHub ↗

Syntactic sugar to easily instantiate a `CharsXY` at `(x,y)`. Note that the input arguments here are swapped. This is partly because of historical reasons, but also because virtually all editors (including this one) display file positions with the line first followed by the column. It's easier to reason about the tests below when the order of the arguments to `linecol` matches `yx`.

(y: u16, x: u16)

Source from the content-addressed store, hash-verified

568 /// with the line first followed by the column. It's easier to reason about the tests below
569 /// when the order of the arguments to `linecol` matches `yx`.
570 fn yx(y: u16, x: u16) -> CharsXY {
571 CharsXY::new(x, y)
572 }
573
574 /// Syntactic sugar to easily instantiate a `FilePos` at `(line, col)`.
575 fn linecol(line: usize, col: usize) -> FilePos {

Callers 15

refresh_statusMethod · 0.85
refresh_lineMethod · 0.85
refreshMethod · 0.85
test_program_behaviorFunction · 0.85
test_split_last_lineFunction · 0.85
test_move_in_empty_fileFunction · 0.85
test_move_endFunction · 0.85

Calls

no outgoing calls