File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,16 @@ export function fzf(options: FzfOptions = {}): Matcher {
6666 . map ( ( v ) => {
6767 const column = Math . max ( 0 , v . start + 1 ) ;
6868 const length = Math . max ( 0 , v . end - v . start ) ;
69- if ( length === 0 ) return undefined ;
69+
70+ // NOTE:
71+ // The length become 0 when user use negative match like (!a).
72+ const decorations = ( length === 0 ) ? [ ] : [ { column, length } ] ;
7073
7174 return {
7275 ...v . item ,
7376 decorations : [
7477 ...( v . item . decorations ?? [ ] ) ,
75- { column , length } ,
78+ ... decorations ,
7679 ] ,
7780 } ;
7881 } )
@@ -88,6 +91,6 @@ export function fzf(options: FzfOptions = {}): Matcher {
8891}
8992
9093// deno-lint-ignore no-explicit-any
91- const byTrimmedLengthAsc : Tiebreaker < IdItem < any > > = ( a , b , selector ) => {
94+ const byTrimmedLengthAsc : Tiebreaker < any > = ( a , b , selector ) => {
9295 return selector ( a . item ) . trim ( ) . length - selector ( b . item ) . trim ( ) . length ;
9396} ;
You can’t perform that action at this time.
0 commit comments