mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-04 14:12:11 -07:00
[bash,zsh] Remove redundant filtering-out of comment/blank lines
Comments are anyway removed in the subsequent call to `sub(/#.*/, "")`, and it becomes a blank line. Blank lines do not have fields, so they are ignored in the next for-loop.
This commit is contained in:
committed by
Junegunn Choi
parent
adc9ad28da
commit
4a61f53b85
@@ -513,10 +513,6 @@ if ! declare -F __fzf_list_hosts > /dev/null; then
|
|||||||
) \
|
) \
|
||||||
<(
|
<(
|
||||||
__fzf_exec_awk '
|
__fzf_exec_awk '
|
||||||
# Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of
|
|
||||||
# the form [[:blank:]], and Ubuntu 18.04 LTS still uses this
|
|
||||||
# 16-year-old mawk unfortunately. We need to use [ \t] instead.
|
|
||||||
/^[ \t]*(#|$)/ { next }
|
|
||||||
{
|
{
|
||||||
sub(/#.*/, "")
|
sub(/#.*/, "")
|
||||||
for (i = 2; i <= NF; i++)
|
for (i = 2; i <= NF; i++)
|
||||||
|
@@ -291,10 +291,6 @@ if ! declare -f __fzf_list_hosts > /dev/null; then
|
|||||||
) \
|
) \
|
||||||
<(
|
<(
|
||||||
__fzf_exec_awk '
|
__fzf_exec_awk '
|
||||||
# Note: mawk <= 1.3.3-20090705 does not support the POSIX brackets of
|
|
||||||
# the form [[:blank:]], and Ubuntu 18.04 LTS still uses this
|
|
||||||
# 16-year-old mawk unfortunately. We need to use [ \t] instead.
|
|
||||||
/^[ \t]*(#|$)/ { next }
|
|
||||||
{
|
{
|
||||||
sub(/#.*/, "")
|
sub(/#.*/, "")
|
||||||
for (i = 2; i <= NF; i++)
|
for (i = 2; i <= NF; i++)
|
||||||
|
Reference in New Issue
Block a user