From f0ccabc6263c71ecce0252606232142c9bec534f Mon Sep 17 00:00:00 2001
From: Luca Bilke <bilke@tralios.de>
Date: Thu, 23 May 2024 17:28:32 +0200
Subject: [PATCH] fix dos caused by bad preview code in fzf

---
 .config/lf/lfrc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index d56ddebf..bbf3972c 100644
--- a/.config/lf/lfrc
+++ b/.config/lf/lfrc
@@ -134,7 +134,7 @@ cmd fzf ${{
         --preview='
             file=$(echo {} | cut -d '$delimiter' -f '$path_field')
             if [ -f "$file" ] && [ -r "$file" ]; then
-                head -$LINES "$file"
+                head -n $LINES "$file"
             elif [ -d "$file" ] && [ -r "$file" ]; then
                 ls -pLHAN1 --color=always --group-directories-first "$file"
             fi
@@ -185,7 +185,7 @@ cmd find_project ${{
             f={}
             file=$(echo $XDG_DOCUMENTS_DIR/dev/*/* | xargs -n1 | sed -n "/\/$f$/p")
             if [ -f "$file" ] && [ -r "$file" ]; then
-                head -$LINES "$file"
+                head -n $LINES "$file"
             elif [ -d "$file" ] && [ -r "$file" ]; then
                 ls -pLHAN1 --color=always --group-directories-first "$file"
             fi