skim icon indicating copy to clipboard operation
skim copied to clipboard

Suffix search with option --nth includes delimiter

Open Korkman opened this issue 4 years ago • 2 comments

echo -e "test;alpha\nothertest;beta\ntestother;gamma" | sk --delimiter ';' --nth 1 --query 'other$'

Should show line "testother;gamma", but doesn't.

echo -e "test;alpha\nothertest;beta\ntestother;gamma" | sk --delimiter ';' --nth 1 --query 'other;$'

Solves the mystery: delimiters are not removed from the searched content. This is probably not intended :-)

Korkman avatar May 13 '20 10:05 Korkman

@lotabout I am not too familiar with the GitHub labels, does by-design mean that this is not going to change?

I am wondering about:

echo -e "a:b" | sk -d ':' --with-nth 1

This is showing a: instead of a in the search. This does not seem right to me.

tobx avatar Nov 18 '21 12:11 tobx

This seems like the same behaviour as fzf

@junegunn gave a reasoning for the behaviour (in fzf) here: https://github.com/junegunn/fzf/issues/2154#issuecomment-682589184

I think the key is that the delimiter is a regex.

If it would only allow for a single character, I think the behaviour could be possible as @tobx (and me) expected.

oschrenk avatar Aug 06 '23 00:08 oschrenk