Limit number of characters displayed in "first line" dmenu selector to 500
Fixes #14.
This commit is contained in:
parent
98b959e0d9
commit
95b8cd5698
5
clipmenu
5
clipmenu
|
@ -2,6 +2,9 @@
|
|||
|
||||
LC_COLLATE=C
|
||||
|
||||
# Some people copy/paste huge swathes of text that could slow down dmenu
|
||||
line_length_limit=500
|
||||
|
||||
declare -A selections
|
||||
ordered_selections=()
|
||||
|
||||
|
@ -10,7 +13,7 @@ files=("/tmp/clipmenu.$USER/"*)
|
|||
for (( i=${#files[@]}-1; i>=0; i-- )); do
|
||||
file=${files[$i]}
|
||||
|
||||
first_line=$(sed -n '/./{p;q}' "$file")
|
||||
first_line=$(sed -n '/./{p;q}' "$file" | cut -c1-"$line_length_limit")
|
||||
|
||||
lines=$(wc -l "$file")
|
||||
lines=${lines%% *}
|
||||
|
|
Loading…
Reference in a new issue