Skip to content
Myr

Reformat comments adhere to gofmt

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 4993d19 · Browse files · 7 files+20 added−45 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+20 added−45 removed

  • other:+20 added−45 removed

7 files+20 added−45 removed

modified:.github/workflows/linux.yml+1 added-1 removed
modified:src/ansi_test.go+7 added-7 removed
13 unmodified lines
14// frequently used ANSI sequences. This regex is used as a reference for15// testing nextAnsiEscapeSequence().16//17// References:18// - https://github.com/gnachman/iTerm219// - https://web.archive.org/web/20090204053813/http://ascii-table.com/ansi-escape-sequences.php20// (archived from http://ascii-table.com/ansi-escape-sequences.php)21// - https://web.archive.org/web/20090227051140/http://ascii-table.com/ansi-escape-sequences-vt-100.php22// (archived from http://ascii-table.com/ansi-escape-sequences-vt-100.php)23// - http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html24// - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html18// - https://github.com/gnachman/iTerm219// - https://web.archive.org/web/20090204053813/http://ascii-table.com/ansi-escape-sequences.php20// (archived from http://ascii-table.com/ansi-escape-sequences.php)21// - https://web.archive.org/web/20090227051140/http://ascii-table.com/ansi-escape-sequences-vt-100.php22// (archived from http://ascii-table.com/ansi-escape-sequences-vt-100.php)23// - http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html24// - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html25var ansiRegexReference = regexp.MustCompile("(?:\x1b[\\[()][0-9;]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)")2627func testParserReference(t testing.TB, str string) {28 t.Helper()
399 unmodified lines
modified:src/ansi.go-1 removed
124 unmodified lines
125// nextAnsiEscapeSequence returns the ANSI escape sequence and is equivalent to126// calling FindStringIndex() on the below regex (which was originally used):127//128// "(?:\x1b[\\[()][0-9;?]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)"129//129func nextAnsiEscapeSequence(s string) (int, int) {130 // fast check for ANSI escape sequences131 i := 0132 for ; i < len(s); i++ {
276 unmodified lines
modified:src/core.go+1 added-25 removed
1/*2Package fzf implements fzf, a command-line fuzzy finder.1// Package fzf implements fzf, a command-line fuzzy finder.34The MIT License (MIT)56Copyright (c) 2013-2021 Junegunn Choi78Permission is hereby granted, free of charge, to any person obtaining a copy9of this software and associated documentation files (the "Software"), to deal10in the Software without restriction, including without limitation the rights11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell12copies of the Software, and to permit persons to whom the Software is13furnished to do so, subject to the following conditions:1415The above copyright notice and this permission notice shall be included in16all copies or substantial portions of the Software.1718THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN24THE SOFTWARE.25*/2package fzf34import (5 "fmt"
328 unmodified lines
modified:src/terminal_test.go+3 added-3 removed
419 unmodified lines
420 os.Setenv("SHELL", shellBackup)421}422423/*424 Test typical valid placeholders and parsing of them.424Test typical valid placeholders and parsing of them.425426 Also since the parser assumes the input is matched with `placeholder` regex,427 the regex is tested here as well.426Also since the parser assumes the input is matched with `placeholder` regex,427the regex is tested here as well.428*/429func TestParsePlaceholder(t *testing.T) {430 // give, want pairs431 templates := map[string]string{
207 unmodified lines
modified:src/terminal.go+7 added-7 removed
23 unmodified lines
2425// import "github.com/pkg/profile"2627/*28 Placeholder regex is used to extract placeholders from fzf's template29 strings. Acts as input validation for parsePlaceholder function.30 Describes the syntax, but it is fairly lenient.28Placeholder regex is used to extract placeholders from fzf's template29strings. Acts as input validation for parsePlaceholder function.30Describes the syntax, but it is fairly lenient.3132 The following pseudo regex has been reverse engineered from the33 implementation. It is overly strict, but better describes whats possible.34 As such it is not useful for validation, but rather to generate test35 cases for example.32The following pseudo regex has been reverse engineered from the33implementation. It is overly strict, but better describes whats possible.34As such it is not useful for validation, but rather to generate test35cases for example.3637 \\?(?: # escaped type38 {\+?s?f?RANGE(?:,RANGE)*} # token type39 |{q} # query type
2898 unmodified lines
modified:LICENSE+1 added-1 removed
1The MIT License (MIT)23Copyright (c) 2013-2021 Junegunn Choi3Copyright (c) 2013-2022 Junegunn Choi45Permission is hereby granted, free of charge, to any person obtaining a copy6of this software and associated documentation files (the "Software"), to deal7in the Software without restriction, including without limitation the rights
14 unmodified lines