Skip to content

Commit

Permalink
Use available terminal columns instead of hardcoded 80 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Nov 22, 2023
1 parent 7653f68 commit 829c518
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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"
]
3 changes: 2 additions & 1 deletion src/compiler/args.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ open Common
open CompilationContext

let limit_string s offset =
let rest = 80 - offset in
let width = match Terminal_size.get_columns () with None -> 80 | Some c -> c in
let rest = width - offset in
let words = ExtString.String.nsplit s " " in
let rec loop i words = match words with
| word :: words ->
Expand Down

0 comments on commit 829c518

Please sign in to comment.