MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / buildFilterInfoStr

Function buildFilterInfoStr

ui.go:21–39  ·  view source on GitHub ↗

buildFilterInfoStr builds the filter information string for the top strip Shows all active filters or current column filter when cursor is on a filtered column

(currentColumn int)

Source from the content-addressed store, hash-verified

19// buildFilterInfoStr builds the filter information string for the top strip
20// Shows all active filters or current column filter when cursor is on a filtered column
21func buildFilterInfoStr(currentColumn int) string {
22 if !isFiltered || len(activeFilters) == 0 {
23 return "" // No filter active
24 }
25
26 // Check if current column has a filter
27 if opts, hasFilter := activeFilters[currentColumn]; hasFilter {
28 // Get column name if available
29 columnName := fmt.Sprintf("Column %d", currentColumn)
30 if b.rowFreeze > 0 && len(b.cont) > 0 && currentColumn < len(b.cont[0]) {
31 columnName = b.cont[0][currentColumn]
32 }
33
34 return fmt.Sprintf("🔎 Filter Active: [%s] %s \"%s\" | %d filters total | Press 'r' to remove this filter", columnName, opts.Operator, opts.Query, len(activeFilters))
35 }
36
37 // Show summary if cursor is not on a filtered column
38 return fmt.Sprintf("🔎 %d filters active | Navigate to filtered column and press 'r' to remove", len(activeFilters))
39}
40
41// add buffer data to buffer table with optimized wrapped column lookup
42func drawBuffer(b *Buffer, t *tview.Table) {

Callers 1

drawUIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected