mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
Merge pull request #649 from peco/extraoffset-to-const
Move variable to platform specific const
This commit is contained in:
commit
785f8e264d
|
|
@ -14,7 +14,10 @@ import (
|
|||
"github.com/peco/peco/line"
|
||||
)
|
||||
|
||||
var extraOffset int = 0
|
||||
// extraOffset is a platform-specific constant that adds extra vertical
|
||||
// space to layout anchors. On Windows, terminals need an additional line
|
||||
// reserved at the bottom. Set per-platform via layout_windows.go and
|
||||
// layout_notwindows.go.
|
||||
|
||||
// ansiLiner is an optional interface for lines that carry ANSI color attributes.
|
||||
type ansiLiner interface {
|
||||
|
|
|
|||
5
layout_any.go
Normal file
5
layout_any.go
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
//go:build !windows
|
||||
|
||||
package peco
|
||||
|
||||
const extraOffset = 0
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
package peco
|
||||
|
||||
func init() {
|
||||
// This is the value we pass to anchor offset when we're running
|
||||
// on windows platform
|
||||
extraOffset = 1
|
||||
}
|
||||
// extraOffset reserves one additional line at the bottom on Windows
|
||||
// to account for platform-specific terminal rendering behavior.
|
||||
const extraOffset = 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue