<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fzf/src/algo/algo_test.go, branch v0.66.0-custom</title>
<subtitle>Personal fork of fzf</subtitle>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/'/>
<entry>
<title>Normalize char before pattern lookup (#4252)</title>
<updated>2025-02-17T11:50:15+00:00</updated>
<author>
<name>Alexei Șerșun</name>
<email>alexei.sersun@yahoo.com</email>
</author>
<published>2025-02-17T11:50:15+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=01d9d9c8c895de728e7abcad1723db019280452d'/>
<id>01d9d9c8c895de728e7abcad1723db019280452d</id>
<content type='text'>
There is an edge-case in FuzzyMatchV1 during backward scan, related to
normalization: if string is initially denormalized (e.g. Unicode symbol),
backward scan will proceed further to the next char; however, when the
score is computed, the string is normalized first, then scanned based on
the pattern. This leads to accessing pattern index increment, which
itself leads to out-of-bound index access, resulting in a panic.

To illustrate the process, here's the sequence of operations when search
is perfored:

1. during backward scan by "minim" pattern

```
xxxxx Minímal example
      ^^^^^^^^^^^^
      ||||||||||||
      miniiiiiiiim &lt;- compute score for this substring
```
2. during compute score by "minim" pattern
```
      Minímal exam
      minimal exam &lt;- normalize chars before computing the score
      ^^^^^^
      ||||||
      minim &lt;- at this point the pattern is already fully scanned and index
              is out-of-the-bound
```

In this commit the char is normalized during backward scan, to detect
properly the boundaries for the pattern.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is an edge-case in FuzzyMatchV1 during backward scan, related to
normalization: if string is initially denormalized (e.g. Unicode symbol),
backward scan will proceed further to the next char; however, when the
score is computed, the string is normalized first, then scanned based on
the pattern. This leads to accessing pattern index increment, which
itself leads to out-of-bound index access, resulting in a panic.

To illustrate the process, here's the sequence of operations when search
is perfored:

1. during backward scan by "minim" pattern

```
xxxxx Minímal example
      ^^^^^^^^^^^^
      ||||||||||||
      miniiiiiiiim &lt;- compute score for this substring
```
2. during compute score by "minim" pattern
```
      Minímal exam
      minimal exam &lt;- normalize chars before computing the score
      ^^^^^^
      ||||||
      minim &lt;- at this point the pattern is already fully scanned and index
              is out-of-the-bound
```

In this commit the char is normalized during backward scan, to detect
properly the boundaries for the pattern.</pre>
</div>
</content>
</entry>
<entry>
<title>Improve search performance by pre-calculating character classes</title>
<updated>2024-04-14T02:47:05+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2024-04-13T07:11:18+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=7ce6452d83a62a3bc409fef8face1cfaef6e0146'/>
<id>7ce6452d83a62a3bc409fef8face1cfaef6e0146</id>
<content type='text'>
This simple optmization can give more than 15% performance boost
in some scenarios.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This simple optmization can give more than 15% performance boost
in some scenarios.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add --scheme=[default|path|history] option to choose scoring scheme</title>
<updated>2022-08-28T13:22:39+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2022-08-28T13:16:57+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=6fb41a202a97ad3f2437f6e5aee8890268560412'/>
<id>6fb41a202a97ad3f2437f6e5aee8890268560412</id>
<content type='text'>
Close #2909
Close #2930
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close #2909
Close #2930
</pre>
</div>
</content>
</entry>
<entry>
<title>Tweak bonus points to word boundaries</title>
<updated>2022-08-02T11:57:13+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2022-07-30T13:11:21+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=c3a7a24eeaa5b7451e652df68683b5e8b24cde6b'/>
<id>c3a7a24eeaa5b7451e652df68683b5e8b24cde6b</id>
<content type='text'>
Close https://github.com/junegunn/fzf.vim/issues/1004

  # jobs/latency.js is favored over job_latency.js
  printf 'job_latency.js\njobs/latency.js' | fzf -qlatency
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close https://github.com/junegunn/fzf.vim/issues/1004

  # jobs/latency.js is favored over job_latency.js
  printf 'job_latency.js\njobs/latency.js' | fzf -qlatency
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix spelling error (Extention -&gt; Extension) (#2589)</title>
<updated>2021-08-17T07:40:24+00:00</updated>
<author>
<name>Keating950</name>
<email>keating.reid@protonmail.com</email>
</author>
<published>2021-08-17T07:40:24+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=3f90fb42d8871920138ace9878502f22a4d91e85'/>
<id>3f90fb42d8871920138ace9878502f22a4d91e85</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix prefix/suffix/equal matcher to trim whitespaces</title>
<updated>2020-03-01T03:36:02+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2020-03-01T03:36:02+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=4c9cab3f8ae7b55f7124d7c3cf7ac6b4cc3db210'/>
<id>4c9cab3f8ae7b55f7124d7c3cf7ac6b4cc3db210</id>
<content type='text'>
- Prefix matcher will trim leading whitespaces only when the pattern
  doesn't start with a whitespace
- Suffix matcher will trim trailing whitespaces only when the pattern
  doesn't end with a whitespace
- Equal matcher will trim leading whitespaces only when the pattern
  doesn't start with a whitespace, and trim trailing whitespaces only
  when the pattern doesn't end with a whitespace

Previously, only suffix matcher would trim whitespaces unconditionally.

Fix #1894
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Prefix matcher will trim leading whitespaces only when the pattern
  doesn't start with a whitespace
- Suffix matcher will trim trailing whitespaces only when the pattern
  doesn't end with a whitespace
- Equal matcher will trim leading whitespaces only when the pattern
  doesn't start with a whitespace, and trim trailing whitespaces only
  when the pattern doesn't end with a whitespace

Previously, only suffix matcher would trim whitespaces unconditionally.

Fix #1894
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass util.Chars by pointer</title>
<updated>2017-08-20T03:29:11+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2017-08-19T18:33:55+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=a2a4df088646a5f363f9321c52ef9ab9ba4706aa'/>
<id>a2a4df088646a5f363f9321c52ef9ab9ba4706aa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Further reduce unnecessary rune array conversion</title>
<updated>2017-07-21T08:31:11+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2017-07-21T08:29:14+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=bd98f988f0502251d13650afddde1916ad87d28d'/>
<id>bd98f988f0502251d13650afddde1916ad87d28d</id>
<content type='text'>
I was too quick to release 0.16.9, this commit makes --ansi processing
even faster.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I was too quick to release 0.16.9, this commit makes --ansi processing
even faster.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add --normalize option to normalize latin script characters</title>
<updated>2017-01-08T18:12:23+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2017-01-08T18:12:23+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=45793d75c2d168d51be3578b8d785159ec81ff92'/>
<id>45793d75c2d168d51be3578b8d785159ec81ff92</id>
<content type='text'>
Close #790
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close #790
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix panic when pattern occurs after 2^15-th column</title>
<updated>2016-09-20T16:15:06+00:00</updated>
<author>
<name>Junegunn Choi</name>
<email>junegunn.c@gmail.com</email>
</author>
<published>2016-09-20T16:15:06+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/fzf/commit/?id=791076d3662f04a20386f6ea9d166f6eccbd1a81'/>
<id>791076d3662f04a20386f6ea9d166f6eccbd1a81</id>
<content type='text'>
Fix #666
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix #666
</pre>
</div>
</content>
</entry>
</feed>
