mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-17 02:50:49 +01:00
Move regexp compilation out of render function so it isn't run once for every single cell
This commit is contained in:
parent
3feb267038
commit
e04583f62f
@ -584,8 +584,8 @@ func makeTable(ctx context.Context, rows []table.Row) (table.Model, error) {
|
||||
Background(lipgloss.Color("57")).
|
||||
Bold(false)
|
||||
if config.BetaMode {
|
||||
MATCH_NOTHING_REGEXP := regexp.MustCompile("a^")
|
||||
s.RenderCell = func(model table.Model, value string, position table.CellPosition) string {
|
||||
MATCH_NOTHING_REGEXP := regexp.MustCompile("a^")
|
||||
var re *regexp.Regexp
|
||||
CURRENT_QUERY_FOR_HIGHLIGHTING = strings.TrimSpace(CURRENT_QUERY_FOR_HIGHLIGHTING)
|
||||
if CURRENT_QUERY_FOR_HIGHLIGHTING == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user