mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-10 10:16:20 +00:00
Replace --normalize with --literal and enable normalization by default
Ref #790
This commit is contained in:
parent
03f5ef08c8
commit
4ecb7f3a16
@ -6,8 +6,9 @@ CHANGELOG
|
|||||||
- Added `--height HEIGHT[%]` option
|
- Added `--height HEIGHT[%]` option
|
||||||
- Preview window will truncate long lines by default. Line wrap can be enabled
|
- Preview window will truncate long lines by default. Line wrap can be enabled
|
||||||
by `:wrap` flag in `--preview-window`.
|
by `:wrap` flag in `--preview-window`.
|
||||||
- Added `--normalize` option to normalize latin script letters before
|
- Latin script letters will be normalized before matching so that it's easier
|
||||||
matching. e.g. `sodanco` can match `Só Danço Samba`.
|
to match against accented letters. e.g. `sodanco` can match `Só Danço Samba`.
|
||||||
|
- Normalization can be disabled via `--literal`
|
||||||
|
|
||||||
0.15.9
|
0.15.9
|
||||||
------
|
------
|
||||||
|
@ -48,9 +48,8 @@ Case-insensitive match (default: smart-case match)
|
|||||||
.B "+i"
|
.B "+i"
|
||||||
Case-sensitive match
|
Case-sensitive match
|
||||||
.TP
|
.TP
|
||||||
.B "--normalize"
|
.B "--literal"
|
||||||
Normalize latin script letters before matching. This is not enabled by default
|
Do not normalize latin script letters for matching.
|
||||||
to avoid performance overhead.
|
|
||||||
.TP
|
.TP
|
||||||
.BI "--algo=" TYPE
|
.BI "--algo=" TYPE
|
||||||
Fuzzy matching algorithm (default: v2)
|
Fuzzy matching algorithm (default: v2)
|
||||||
|
@ -67,6 +67,7 @@ _fzf_opts_completion() {
|
|||||||
--no-hscroll
|
--no-hscroll
|
||||||
--jump-labels
|
--jump-labels
|
||||||
--height
|
--height
|
||||||
|
--literal
|
||||||
--reverse
|
--reverse
|
||||||
--margin
|
--margin
|
||||||
--inline-info
|
--inline-info
|
||||||
|
@ -24,7 +24,7 @@ const usage = `usage: fzf [options]
|
|||||||
--algo=TYPE Fuzzy matching algorithm: [v1|v2] (default: v2)
|
--algo=TYPE Fuzzy matching algorithm: [v1|v2] (default: v2)
|
||||||
-i Case-insensitive match (default: smart-case match)
|
-i Case-insensitive match (default: smart-case match)
|
||||||
+i Case-sensitive match
|
+i Case-sensitive match
|
||||||
--normalize Normalize latin script letters before matching
|
--literal Do not normalize latin script letters before matching
|
||||||
-n, --nth=N[,..] Comma-separated list of field index expressions
|
-n, --nth=N[,..] Comma-separated list of field index expressions
|
||||||
for limiting search scope. Each can be a non-zero
|
for limiting search scope. Each can be a non-zero
|
||||||
integer or a range expression ([BEGIN]..[END]).
|
integer or a range expression ([BEGIN]..[END]).
|
||||||
@ -190,7 +190,7 @@ func defaultOptions() *Options {
|
|||||||
FuzzyAlgo: algo.FuzzyMatchV2,
|
FuzzyAlgo: algo.FuzzyMatchV2,
|
||||||
Extended: true,
|
Extended: true,
|
||||||
Case: CaseSmart,
|
Case: CaseSmart,
|
||||||
Normalize: false,
|
Normalize: true,
|
||||||
Nth: make([]Range, 0),
|
Nth: make([]Range, 0),
|
||||||
WithNth: make([]Range, 0),
|
WithNth: make([]Range, 0),
|
||||||
Delimiter: Delimiter{},
|
Delimiter: Delimiter{},
|
||||||
@ -901,10 +901,10 @@ func parseOptions(opts *Options, allArgs []string) {
|
|||||||
case "-f", "--filter":
|
case "-f", "--filter":
|
||||||
filter := nextString(allArgs, &i, "query string required")
|
filter := nextString(allArgs, &i, "query string required")
|
||||||
opts.Filter = &filter
|
opts.Filter = &filter
|
||||||
case "--normalize":
|
case "--literal":
|
||||||
opts.Normalize = true
|
|
||||||
case "--no-normalize":
|
|
||||||
opts.Normalize = false
|
opts.Normalize = false
|
||||||
|
case "--no-literal":
|
||||||
|
opts.Normalize = true
|
||||||
case "--algo":
|
case "--algo":
|
||||||
opts.FuzzyAlgo = parseAlgo(nextString(allArgs, &i, "algorithm required (v1|v2)"))
|
opts.FuzzyAlgo = parseAlgo(nextString(allArgs, &i, "algorithm required (v1|v2)"))
|
||||||
case "--expect":
|
case "--expect":
|
||||||
|
Loading…
Reference in New Issue
Block a user