1
1
mirror of https://github.com/walles/moar.git synced 2024-09-21 17:08:34 +03:00
moar/m
Steven Penny f3dd0389e5 m: make Page a method
Page is a great function, but it is limited, because it makes too many choices
for the user. The global DeInit was a good start, but really that shouldve always
been a Pager field.

Move DeInit inside Pager, and set default to true as before in the NewPager
function. Then, users can call Page, but still have control over DeInit, as well
as Line Numbers, and not have to worry about creating a Screen. Example code:

    r := m.NewReaderFromText("moar", strings.Repeat("moar\n", 99))
    p := m.NewPager(r)
    p.DeInit, p.ShowLineNumbers = false, false
    p.Page()
2021-04-11 21:55:03 -05:00
..
ansiTokenizer_test.go Make a lot fewer functions public 2020-12-29 22:57:44 +01:00
ansiTokenizer.go Parse lines on demand and only once 2021-01-11 10:42:34 +01:00
embed-api.go m: make Page a method 2021-04-11 21:55:03 -05:00
matchRanges_test.go Make a lot fewer functions public 2020-12-29 22:57:44 +01:00
matchRanges.go Make a lot fewer functions public 2020-12-29 22:57:44 +01:00
pager_test.go ShowLineNumbers: complete implementation 2021-04-10 00:16:34 -05:00
pager.go m: make Page a method 2021-04-11 21:55:03 -05:00
reader_test.go Parse lines on demand and only once 2021-01-11 10:42:34 +01:00
reader.go Parse lines on demand and only once 2021-01-11 10:42:34 +01:00