Skip to content

Commit 0e1e1cf

Browse files
committed
[SQUASHED] filter-files
1 parent 8012859 commit 0e1e1cf

23 files changed

+243
-73
lines changed

docs-master/keybindings/Keybindings_en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
7171
| `` - `` | Collapse all files | Collapse all directories in the files tree |
7272
| `` = `` | Expand all files | Expand all directories in the file tree |
7373
| `` 0 `` | Focus main view | |
74-
| `` / `` | Search the current view by text | |
74+
| `` / `` | Filter the current view by text | |
7575

7676
## Commit summary
7777

@@ -160,7 +160,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
160160
| `` - `` | Collapse all files | Collapse all directories in the files tree |
161161
| `` = `` | Expand all files | Expand all directories in the file tree |
162162
| `` 0 `` | Focus main view | |
163-
| `` / `` | Search the current view by text | |
163+
| `` / `` | Filter the current view by text | |
164164

165165
## Input prompt
166166

docs-master/keybindings/Keybindings_ja.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ _凡例:`<c-b>` はctrl+b、`<a-b>` はalt+b、`B` はshift+bを意味
119119
| `` - `` | すべてのファイルを折りたたむ | ファイルツリー内のすべてのディレクトリを折りたたみます |
120120
| `` = `` | すべてのファイルを展開 | ファイルツリー内のすべてのディレクトリを展開します |
121121
| `` 0 `` | メインビューにフォーカス | |
122-
| `` / `` | 現在のビューをテキストで検索 | |
122+
| `` / `` | 現在のビューをテキストでフィルタリング | |
123123

124124
## コミット概要
125125

@@ -242,7 +242,7 @@ _凡例:`<c-b>` はctrl+b、`<a-b>` はalt+b、`B` はshift+bを意味
242242
| `` - `` | すべてのファイルを折りたたむ | ファイルツリー内のすべてのディレクトリを折りたたみます |
243243
| `` = `` | すべてのファイルを展開 | ファイルツリー内のすべてのディレクトリを展開します |
244244
| `` 0 `` | メインビューにフォーカス | |
245-
| `` / `` | 現在のビューをテキストで検索 | |
245+
| `` / `` | 現在のビューをテキストでフィルタリング | |
246246

247247
## メインパネル(ステージング)
248248

docs-master/keybindings/Keybindings_ko.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
348348
| `` - `` | Collapse all files | Collapse all directories in the files tree |
349349
| `` = `` | Expand all files | Expand all directories in the file tree |
350350
| `` 0 `` | Focus main view | |
351-
| `` / `` | 검색 시작 | |
351+
| `` / `` | Filter the current view by text | |
352352

353353
## 커밋메시지
354354

@@ -404,7 +404,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
404404
| `` - `` | Collapse all files | Collapse all directories in the files tree |
405405
| `` = `` | Expand all files | Expand all directories in the file tree |
406406
| `` 0 `` | Focus main view | |
407-
| `` / `` | 검색 시작 | |
407+
| `` / `` | Filter the current view by text | |
408408

409409
## 확인 패널
410410

docs-master/keybindings/Keybindings_nl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
8484
| `` - `` | Collapse all files | Collapse all directories in the files tree |
8585
| `` = `` | Expand all files | Expand all directories in the file tree |
8686
| `` 0 `` | Focus main view | |
87-
| `` / `` | Start met zoeken | |
87+
| `` / `` | Filter the current view by text | |
8888

8989
## Bevestigingspaneel
9090

@@ -149,7 +149,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
149149
| `` - `` | Collapse all files | Collapse all directories in the files tree |
150150
| `` = `` | Expand all files | Expand all directories in the file tree |
151151
| `` 0 `` | Focus main view | |
152-
| `` / `` | Start met zoeken | |
152+
| `` / `` | Filter the current view by text | |
153153

154154
## Commits
155155

docs-master/keybindings/Keybindings_pl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
259259
| `` - `` | Collapse all files | Collapse all directories in the files tree |
260260
| `` = `` | Expand all files | Expand all directories in the file tree |
261261
| `` 0 `` | Focus main view | |
262-
| `` / `` | Szukaj w bieżącym widoku po tekście | |
262+
| `` / `` | Filtruj bieżący widok po tekście | |
263263

264264
## Pliki commita
265265

@@ -279,7 +279,7 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
279279
| `` - `` | Collapse all files | Collapse all directories in the files tree |
280280
| `` = `` | Expand all files | Expand all directories in the file tree |
281281
| `` 0 `` | Focus main view | |
282-
| `` / `` | Szukaj w bieżącym widoku po tekście | |
282+
| `` / `` | Filtruj bieżący widok po tekście | |
283283

284284
## Podsumowanie commita
285285

docs-master/keybindings/Keybindings_pt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
8484
| `` - `` | Recolher todos os arquivos | Recolher todos os diretórios na árvore de arquivos |
8585
| `` = `` | Expandir todos os arquivos | Expandir todos os diretórios na árvore do arquivo |
8686
| `` 0 `` | Focus main view | |
87-
| `` / `` | Search the current view by text | |
87+
| `` / `` | Filter the current view by text | |
8888

8989
## Branches locais
9090

@@ -153,7 +153,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
153153
| `` - `` | Recolher todos os arquivos | Recolher todos os diretórios na árvore de arquivos |
154154
| `` = `` | Expandir todos os arquivos | Expandir todos os diretórios na árvore do arquivo |
155155
| `` 0 `` | Focus main view | |
156-
| `` / `` | Search the current view by text | |
156+
| `` / `` | Filter the current view by text | |
157157

158158
## Commits
159159

docs-master/keybindings/Keybindings_ru.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ _Связки клавиш_
307307
| `` - `` | Collapse all files | Collapse all directories in the files tree |
308308
| `` = `` | Expand all files | Expand all directories in the file tree |
309309
| `` 0 `` | Focus main view | |
310-
| `` / `` | Найти | |
310+
| `` / `` | Filter the current view by text | |
311311

312312
## Статус
313313

@@ -398,7 +398,7 @@ _Связки клавиш_
398398
| `` - `` | Collapse all files | Collapse all directories in the files tree |
399399
| `` = `` | Expand all files | Expand all directories in the file tree |
400400
| `` 0 `` | Focus main view | |
401-
| `` / `` | Найти | |
401+
| `` / `` | Filter the current view by text | |
402402

403403
## Хранилище
404404

docs-master/keybindings/Keybindings_zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
183183
| `` - `` | 折叠全部文件 | 折叠文件树中的全部目录 |
184184
| `` = `` | 展开全部文件 | 展开文件树中的全部目录 |
185185
| `` 0 `` | 聚焦主视图 | |
186-
| `` / `` | 开始搜索 | |
186+
| `` / `` | 通过文本过滤当前视图 | |
187187

188188
## 文件
189189

@@ -216,7 +216,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
216216
| `` - `` | 折叠全部文件 | 折叠文件树中的全部目录 |
217217
| `` = `` | 展开全部文件 | 展开文件树中的全部目录 |
218218
| `` 0 `` | 聚焦主视图 | |
219-
| `` / `` | 开始搜索 | |
219+
| `` / `` | 通过文本过滤当前视图 | |
220220

221221
## 本地分支
222222

pkg/gui/context/commit_files_context.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package context
33
import (
44
"fmt"
55

6-
"github.com/jesseduffield/gocui"
76
"github.com/jesseduffield/lazygit/pkg/commands/models"
87
"github.com/jesseduffield/lazygit/pkg/gui/filetree"
98
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
@@ -17,13 +16,12 @@ type CommitFilesContext struct {
1716
*filetree.CommitFileTreeViewModel
1817
*ListContextTrait
1918
*DynamicTitleBuilder
20-
*SearchTrait
2119
}
2220

2321
var (
2422
_ types.IListContext = (*CommitFilesContext)(nil)
2523
_ types.DiffableContext = (*CommitFilesContext)(nil)
26-
_ types.ISearchableContext = (*CommitFilesContext)(nil)
24+
_ types.IFilterableContext = (*CommitFilesContext)(nil)
2725
)
2826

2927
func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext {
@@ -48,7 +46,6 @@ func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext {
4846
ctx := &CommitFilesContext{
4947
CommitFileTreeViewModel: viewModel,
5048
DynamicTitleBuilder: NewDynamicTitleBuilder(c.Tr.CommitFilesDynamicTitle),
51-
SearchTrait: NewSearchTrait(c),
5249
ListContextTrait: &ListContextTrait{
5350
Context: NewSimpleContext(
5451
NewBaseContext(NewBaseContextOpts{
@@ -68,9 +65,6 @@ func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext {
6865
},
6966
}
7067

71-
ctx.GetView().SetRenderSearchStatus(ctx.SearchTrait.RenderSearchStatus)
72-
ctx.GetView().SetOnSelectItem(ctx.OnSearchSelect)
73-
7468
return ctx
7569
}
7670

@@ -93,10 +87,6 @@ func (self *CommitFilesContext) GetFromAndToForDiff() (string, string) {
9387
return ref.ParentRefName(), ref.RefName()
9488
}
9589

96-
func (self *CommitFilesContext) ModelSearchResults(searchStr string, caseSensitive bool) []gocui.SearchPosition {
97-
return nil
98-
}
99-
10090
func (self *CommitFilesContext) ReInit(ref models.Ref, refRange *types.RefRange) {
10191
self.SetRef(ref)
10292
self.SetRefRange(refRange)

pkg/gui/context/working_tree_context.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package context
22

33
import (
4-
"github.com/jesseduffield/gocui"
54
"github.com/jesseduffield/lazygit/pkg/commands/models"
65
"github.com/jesseduffield/lazygit/pkg/gui/filetree"
76
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
@@ -13,12 +12,11 @@ import (
1312
type WorkingTreeContext struct {
1413
*filetree.FileTreeViewModel
1514
*ListContextTrait
16-
*SearchTrait
1715
}
1816

1917
var (
2018
_ types.IListContext = (*WorkingTreeContext)(nil)
21-
_ types.ISearchableContext = (*WorkingTreeContext)(nil)
19+
_ types.IFilterableContext = (*WorkingTreeContext)(nil)
2220
)
2321

2422
func NewWorkingTreeContext(c *ContextCommon) *WorkingTreeContext {
@@ -38,7 +36,6 @@ func NewWorkingTreeContext(c *ContextCommon) *WorkingTreeContext {
3836
}
3937

4038
ctx := &WorkingTreeContext{
41-
SearchTrait: NewSearchTrait(c),
4239
FileTreeViewModel: viewModel,
4340
ListContextTrait: &ListContextTrait{
4441
Context: NewSimpleContext(NewBaseContext(NewBaseContextOpts{
@@ -56,12 +53,5 @@ func NewWorkingTreeContext(c *ContextCommon) *WorkingTreeContext {
5653
},
5754
}
5855

59-
ctx.GetView().SetRenderSearchStatus(ctx.SearchTrait.RenderSearchStatus)
60-
ctx.GetView().SetOnSelectItem(ctx.OnSearchSelect)
61-
6256
return ctx
6357
}
64-
65-
func (self *WorkingTreeContext) ModelSearchResults(searchStr string, caseSensitive bool) []gocui.SearchPosition {
66-
return nil
67-
}

0 commit comments

Comments
 (0)