Clean up non-ascii characters
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Junegunn Choi · committed by Junegunn Choi · parent 780a624 · Browse files · 9 files·+33 added−33 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+33 added−33 removed
- tests:+10 added−10 removed
- other:+23 added−23 removed
Provenance
- Commit
8b66489- Tree
9857c7b- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
780a624
9 files changed+33 added−33 removed
modified:src/algo/indexbyte2_arm64.s+1 added-1 removed
76 unmodified lines77 VMOV V6.D[0], R678 CBZ R6, loop79 80 end:81- // Found something or out of data — build full syndrome81+ // Found something or out of data, build full syndrome82 VAND V5.B16, V3.B16, V3.B1683 VAND V5.B16, V4.B16, V4.B1684 VADDP V4.B16, V3.B16, V6.B1685 VADDP V6.B16, V6.B16, V6.B16164 unmodified linesmodified:src/algo/SIMD.md+5 added-5 removed
1234556788910111277 unmodified lines90919293949594959697989899# SIMD byte search: `indexByteTwo` / `lastIndexByteTwo`
## What these functions do
`indexByteTwo(s []byte, b1, b2 byte) int` — returns the index of the`indexByteTwo(s []byte, b1, b2 byte) int` -- returns the index of the**first** occurrence of `b1` or `b2` in `s`, or `-1`.
`lastIndexByteTwo(s []byte, b1, b2 byte) int` — returns the index of the`lastIndexByteTwo(s []byte, b1, b2 byte) int` -- returns the index of the**last** occurrence of `b1` or `b2` in `s`, or `-1`.
They are used by the fuzzy matching algorithm (`algo.go`) to skip aheadduring case-insensitive search. Instead of calling `bytes.IndexByte` twice77 unmodified lines## Correctness verification
The assembly is verified by three layers of testing:
1. **Table-driven tests** — known inputs with expected outputs.2. **Exhaustive tests** — all lengths 0–256, every match position, no-match1. **Table-driven tests** -- known inputs with expected outputs.2. **Exhaustive tests** -- all lengths 0–256, every match position, no-match cases, and both-bytes-present cases, compared against a simple loop reference.3. **Fuzz tests** — randomized inputs via `testing.F`, compared against the3. **Fuzz tests** -- randomized inputs via `testing.F`, compared against the same loop reference.modified:src/tui/tui_test.go+1 added-1 removed
7 unmodified lines8 if len(lines) != 2 || lines[0].Text != "hello w" || lines[1].Text != "orld" {9 t.Errorf("Basic wrap: %v", lines)10 }11 12- // Exact fit — no wrapping needed12+ // Exact fit - no wrapping needed13 lines = WrapLine("hello", 0, 5, 8, 2)14 if len(lines) != 1 || lines[0].Text != "hello" || lines[0].DisplayWidth != 5 {15 t.Errorf("Exact fit: %v", lines)16 }44 unmodified linesmodified:src/ansi.go+1 added-1 removed
482 unmodified lines483 case 3:484 state.attr = state.attr | tui.Italic485 case 4:486 if sep == ':' {487- // SGR 4:N — underline style sub-parameter487+ // SGR 4:N - underline style sub-parameter488 var subNum int489 subNum, _, ansiCode = parseAnsiCode(ansiCode)490 state.attr = state.attr &^ tui.UnderlineStyleMask491 switch subNum {87 unmodified linesmodified:src/terminal_test.go+2 added-2 removed
719 unmodified lines720 if len(result) != 2 || result[0] != "\x1b[31mhello" || result[1] != "\x1b[32mworld" {721 t.Errorf("ANSI: %q", result)722 }723 724- // Long word (no space) — no break, let character wrapping handle it724+ // Long word (no space) - no break, let character wrapping handle it725 result = term.wordWrapAnsiLine("abcdefghij", 5, 2)726 if len(result) != 1 || result[0] != "abcdefghij" {727 t.Errorf("Long word: %q", result)728 }19 unmodified lines748 }749 750 // Tab handling: tab expands to tabstop-aligned width751 term.tabstop = 8752- // "\thi there" — tab at column 0 expands to 8, total "hi" starts at 8752+ // "\thi there" - tab at column 0 expands to 8, total "hi" starts at 8753 // maxWidth=15: "\thi" = 10 wide, "there" = 5 wide, total 16 > 15, wrap at space754 result = term.wordWrapAnsiLine("\thi there", 15, 2)755 if len(result) != 2 || result[0] != "\thi" || result[1] != "there" {756 t.Errorf("Tab: %q", result)14 unmodified linesmodified:test/test_core.rb+9 added-9 removed
1670 unmodified lines1671 assert_includes lines, '> 555'1672 end1673 tmux.send_keys :BSpace, :BSpace, :BSpace1674 1675- # Reload with shuffled order — cursor should track "555"1675+ # Reload with shuffled order - cursor should track "555"1676 tmux.send_keys 'C-r'1677 tmux.until do |lines|1678 assert_equal 1000, lines.match_count1679 assert_includes lines, '> 555'13 unmodified lines1693 # Move up to "2 banana"1694 tmux.send_keys :Up1695 tmux.until { |lines| assert_includes lines, '> 2 banana' }1696 1697- # Reload — the second field changes, but first field "2" stays1697+ # Reload - the second field changes, but first field "2" stays1698 tmux.send_keys 'C-r'1699 tmux.until do |lines|1700 assert_equal 3, lines.match_count1701 assert_includes lines, '> 2 blueberry'6 unmodified lines1708 tmux.until { |lines| assert_equal 3, lines.match_count }1709 tmux.send_keys :Up1710 tmux.until { |lines| assert_includes lines, '> beta' }1711 1712- # Reload with completely different items — no match for "beta"1712+ # Reload with completely different items - no match for "beta"1713 # Cursor stays at the same position (second item)1714 tmux.send_keys 'C-r'1715 tmux.until do |lines|1716 assert_equal 3, lines.match_count9 unmodified lines1726 assert_equal 100, lines.match_count1727 assert_includes lines[-2], '+T'1728 end1729 1730- # Trigger slow reload — should show +T* while blocked1730+ # Trigger slow reload - should show +T* while blocked1731 tmux.send_keys 'C-r'1732 tmux.until { |lines| assert_includes lines[-2], '+T*' }1733 1734 # After reload completes, +T* should clear back to +T33 unmodified lines1768 assert_equal 5, lines.match_count1769 assert_includes lines, '> 1'1770 end1771 1772- # Trigger reload — blocked during initial sleep1772+ # Trigger reload - blocked during initial sleep1773 tmux.send_keys 'C-r'1774 tmux.until { |lines| assert_includes lines[-2], '+T*' }1775 # Match "1" arrives, unblocks before the remaining items load1776 tmux.until do |lines|12 unmodified lines1789 assert_equal 5, lines.match_count1790 assert_includes lines, '> 1'1791 end1792 1793- # Trigger reload-sync — every observable state must be either:1793+ # Trigger reload-sync - every observable state must be either:1794 # 1. +T* (still blocked), or1795 # 2. final state (count=10, +T without *)1796 # Any other combination (e.g. unblocked while count < 10) is a bug.1797 tmux.send_keys 'C-r'36 unmodified lines1834 tmux.until { |lines| assert_equal 3, lines.match_count }1835 tmux.send_keys :Up1836 tmux.until { |lines| assert_includes lines, '> beta' }1837 1838- # Reload with completely different items — no match for "beta"1838+ # Reload with completely different items - no match for "beta"1839 tmux.send_keys 'C-r'1840 tmux.until { |lines| assert_includes lines[-2], '+T*' }1841 # After stream completes, unblocks with cursor at same position (second item)1842 tmux.until do |lines|13 unmodified lines1856 tmux.until { |lines| assert_includes lines, '> 2 banana' }1857 tmux.send_keys 'C-t'1858 tmux.until { |lines| assert_includes lines[-2], '+t' }1859 1860- # Reload — should track by field "2"1860+ # Reload - should track by field "2"1861 tmux.send_keys 'C-r'1862 tmux.until do |lines|1863 assert_equal 3, lines.match_count1864 assert_includes lines, '> 2 blueberry'10 unmodified lines1875 tmux.send_keys :Tab1876 tmux.send_keys :Up, :Up, :Tab1877 tmux.until { |lines| assert_includes lines[-2], '(2)' }1878 1879- # Reload — selections should be preserved by id-nth key1879+ # Reload - selections should be preserved by id-nth key1880 tmux.send_keys 'C-r'1881 tmux.until do |lines|1882 assert_equal 3, lines.match_count1883 assert_includes lines[-2], '(2)'803 unmodified linesmodified:test/test_server.rb+1 added-1 removed
38 unmodified lines39 assert_equal '10', state[:current][:text]40 assert_equal [0, 1], state[:current][:positions]41 assert_equal state[:current][:positions], state[:current][:positions].sort42 43- # No match — no current item43+ # No match - no current item44 Net::HTTP.post(fn.call, 'change-query(yo)+reload(seq 100)+change-prompt:hundred> ')45 tmux.until { |lines| assert_equal 100, lines.item_count }46 tmux.until { |lines| assert_equal 'hundred> yo', lines[-1] }47 state = JSON.parse(Net::HTTP.get(fn.call), symbolize_names: true)40 unmodified linesmodified:ADVANCED.md+7 added-7 removed
307 unmodified lines308 `-1` tells fzf to keep the original color from the input. See `man fzf` for309 available color options.310 - The value of `--preview-window` option consists of 5 components delimited311 by `,`312- 1. `up` — Position of the preview window313- 1. `60%` — Size of the preview window314- 1. `border-bottom` — Preview window border only on the bottom side315- 1. `+{2}+3/3` — Scroll offset of the preview contents316- 1. `~3` — Fixed header312+ 1. `up` -- Position of the preview window313+ 1. `60%` -- Size of the preview window314+ 1. `border-bottom` -- Preview window border only on the bottom side315+ 1. `+{2}+3/3` -- Scroll offset of the preview contents316+ 1. `~3` -- Fixed header317 - Let's break down the latter two. We want to display the bat output in the318 preview window with a certain scroll offset so that the matching line is319 positioned near the center of the preview window.320- - `+{2}` — The base offset is extracted from the second token321- - `+3` — We add 3 lines to the base offset to compensate for the header320+ - `+{2}` -- The base offset is extracted from the second token321+ - `+3` -- We add 3 lines to the base offset to compensate for the header322 part of `bat` output323 - ```324 ───────┬──────────────────────────────────────────────────────────325 │ File: CHANGELOG.md389 unmodified linesmodified:README.md+6 added-6 removed
13 unmodified lines14 <br/>15 <a href="https://commitgoods.com/collections/fzf"><img src="https://junegunn.github.io/fzf/images/fzf-mugs.jpg" width="80%" alt="fzf merch"></a>16 <br/>17 <br/>18- Show your love for fzf — T-shirts, mugs, and stickers now available!18+ Show your love for fzf -- T-shirts, mugs, and stickers now available!19 <br/>20 <br/>21 <a href="https://commitgoods.com/collections/fzf">commitgoods.com/collections/fzf</a>22 <br/>13 unmodified lines36 37 Highlights38 ----------39 40-- **Portable** — Distributed as a single binary for easy installation41-- **Fast** — Optimized to process millions of items instantly42-- **Versatile** — Fully customizable through an event-action binding mechanism43-- **All-inclusive** — Comes with integrations for Bash, Zsh, Fish, Vim, and Neovim40+- **Portable** -- Distributed as a single binary for easy installation41+- **Fast** -- Optimized to process millions of items instantly42+- **Versatile** -- Fully customizable through an event-action binding mechanism43+- **All-inclusive** -- Comes with integrations for Bash, Zsh, Fish, Vim, and Neovim44 45 Table of Contents46 -----------------47 391 unmodified lines439 ### Customizing the look440 441 The user interface of fzf is fully customizable with a large number of442 configuration options. For a quick setup, you can start with one of the style443-presets — `default`, `full`, or `minimal` — using the `--style` option.443+presets -- `default`, `full`, or `minimal` -- using the `--style` option.444 445 ```sh446 fzf --style full \447 --preview 'fzf-preview.sh {}' --bind 'focus:transform-header:file --brief {}'663 unmodified lines