1package peco 2 3func (l *Location) SetColumn(n int) { 4 l.col = n 5} 6 7func (l Location) Column() int { 8 return l.col 9} 10 11func (l *Location) SetLineNumber(n int) { 12 l.lineno = n 13} 14 15func (l Location) LineNumber() int { 16 return l.lineno 17} 18 19func (l *Location) SetOffset(n int) { 20 l.offset = n 21} 22 23func (l Location) Offset() int { 24 return l.offset 25} 26 27func (l *Location) SetPerPage(n int) { 28 l.perPage = n 29} 30 31func (l Location) PerPage() int { 32 return l.perPage 33} 34 35func (l *Location) SetPage(n int) { 36 l.page = n 37} 38 39func (l Location) Page() int { 40 return l.page 41} 42 43func (l *Location) SetTotal(n int) { 44 l.total = n 45} 46 47func (l Location) Total() int { 48 return l.total 49} 50 51func (l *Location) SetMaxPage(n int) { 52 l.maxPage = n 53} 54 55func (l Location) MaxPage() int { 56 return l.maxPage 57} 58 59func (l Location) PageCrop() PageCrop { 60 return PageCrop{ 61 perPage: l.perPage, 62 currentPage: l.page, 63 } 64} 65 66// Crop returns a new Buffer whose contents are 67// bound within the given range 68func (pf PageCrop) Crop(in Buffer) Buffer { 69 return NewFilteredBuffer(in, pf.currentPage, pf.perPage) 70} 71