Skip to content

Commit

Permalink
Use available terminal columns instead of hardcoded 80 columns (#11404)
Browse files Browse the repository at this point in the history
* Use available terminal columns instead of hardcoded 80 columns

* hotfix on phone

* embrace laziness

---------

Co-authored-by: Rudy G <pocket@kla.bz>
Co-authored-by: Simon Krajewski <simon@haxe.org>
  • Loading branch information
3 people committed Nov 22, 2023
1 parent 297353c commit b588672
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions haxe.opam
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ depends: [
"conf-neko"
"luv" {>= "0.5.12"}
"ipaddr"
"terminal_size"
]
4 changes: 3 additions & 1 deletion src/compiler/args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ open Globals
open Common
open CompilationContext

let columns = lazy (match Terminal_size.get_columns () with None -> 80 | Some c -> c)

let limit_string s offset =
let rest = 80 - offset in
let rest = (Lazy.force columns) - offset in
let words = ExtString.String.nsplit s " " in
let rec loop i words = match words with
| word :: words ->
Expand Down
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extc extproc extlib_leftovers ilib javalib mbedtls neko objsize pcre2 camlp-streams swflib ttflib ziplib
json
unix ipaddr str bigarray threads dynlink
xml-light extlib sha
xml-light extlib sha terminal_size
luv
)
(modules (:standard \ haxe))
Expand Down

0 comments on commit b588672

Please sign in to comment.