From b8523b178794d7bcc71ae80c306c28b377e978e0 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 18 Nov 2021 19:47:43 +0300 Subject: cmdfmt: textwidth may be 0 from vim --- .local/bin/cmdfmt | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.local/bin/cmdfmt') diff --git a/.local/bin/cmdfmt b/.local/bin/cmdfmt index 37218d7..634e9c6 100755 --- a/.local/bin/cmdfmt +++ b/.local/bin/cmdfmt @@ -3,6 +3,11 @@ use strict; my $textwidth = $ARGV[0] // 80; + +if ($textwidth == 0) { + $textwidth = 80; +} + # TODO: get tabstop from vim as well <17-11-21, yigit> # my $tabstop = ' ' x 4; -- cgit v1.2.3-70-g09d2