Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sixel-rebase' into sixel-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
horriblename committed May 4, 2023
2 parents bd53c10 + 3509613 commit ebe4072
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ var (
"infotimefmtnew",
"infotimefmtold",
"truncatechar",
"sixel",
"nosixel",
"sixel!",
}
)

Expand Down
2 changes: 1 addition & 1 deletion eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ func (e *setExpr) eval(app *app, args []string) {
app.ui.echoerrf("sixel!: unexpected value: %s", e.val)
return
}
gOpts.wrapscroll = !gOpts.wrapscroll
gOpts.sixel= !gOpts.sixel
default:
// any key with the prefix user_ is accepted as a user defined option
if strings.HasPrefix(e.opt, "user_") {
Expand Down
9 changes: 9 additions & 0 deletions os.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,12 @@ func getTermPixels() (w, h int, err error) {
}
return int(ws.Xpixel), int(ws.Ypixel), nil
}

func getTermPixels() (w, h int, err error) {
fd := int(os.Stdin.Fd())
ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ)
if err != nil {
return -1, -1, err
}
return int(ws.Xpixel), int(ws.Ypixel), nil
}
4 changes: 4 additions & 0 deletions os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,7 @@ func diskFree(wd string) string {
func getTermPixels() (w, h int, err error) {
return -1, -1, nil
}

func getTermPixels() (w, h int, err error) {
return -1, -1, nil
}

0 comments on commit ebe4072

Please sign in to comment.