mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-28 04:41:11 -03:00
Allow specifying a limit on number of expansion in operation_context
If the user types something like `/**`, prior to this change we would attempt to expand it in the background for both highlighting and autosuggestions. This could thrash your disk and also consume a lot of memory. Add a a field to operation_context_t to allow specifying a limit, and add a "default background" limit of 512 items.
This commit is contained in:
@@ -138,7 +138,7 @@ static operation_context_t get_bg_context(const std::shared_ptr<environment_t> &
|
||||
// Cancel if the generation count changed.
|
||||
return generation_count != read_generation_count();
|
||||
};
|
||||
return operation_context_t{nullptr, *env, std::move(cancel_checker)};
|
||||
return operation_context_t{nullptr, *env, std::move(cancel_checker), kExpansionLimitBackground};
|
||||
}
|
||||
|
||||
/// We try to ensure that syntax highlighting completes appropriately before executing what the user
|
||||
|
||||
Reference in New Issue
Block a user