Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buflist optimization: create variables before updating an item #1626

Closed
pascalpoitras opened this issue Apr 3, 2021 · 1 comment
Closed
Assignees
Labels
feature New feature request won't fix This will not be implemented/fixed

Comments

@pascalpoitras
Copy link

Feature description

There is a lot of evaluation in my buflist that gives the same result no matter the buffer. I wonder if it would be a great idea to save the result of theses expressions in variables before updating a buflist item. Then we could use these variables in the buflist.format.* options.

For example, we could use an option with the same format as a regex option for triggers

/set buflist.preformat "/.*/${if:${plugins.var.something}!=?${plugins.var.something}:${if:${plugins.var.something_else}!=?${plugins.var.something_else}:white}}/my_fg_color"

then we could use ${my_fg_color} in place of this more complex evaluation (evaluating just one variable instead of four). This is of course an example, My expression are a lot more complex and would benefit a lot from that

So when a buflist is refresh

  1. evaluate buflist.preformat (in lack of a better name)
  2. update the item
@pascalpoitras pascalpoitras added the feature New feature request label Apr 3, 2021
@pascalpoitras
Copy link
Author

not needed anymore, I have created a modifier and pass it the redundant part and it works perfectly and make the buflist faster

@flashcode flashcode self-assigned this May 13, 2023
@flashcode flashcode added the won't fix This will not be implemented/fixed label May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request won't fix This will not be implemented/fixed
Projects
None yet
Development

No branches or pull requests

2 participants