mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-16 15:04:05 +00:00
Check for cancellation more often in highlighting
This commit is contained in:
parent
8355285736
commit
a65e3f1876
1 changed files with 3 additions and 0 deletions
|
@ -1152,6 +1152,7 @@ highlighter_t::color_array_t highlighter_t::highlight() {
|
|||
|
||||
// Walk the node tree.
|
||||
for (const parse_node_t &node : parse_tree) {
|
||||
if (ctx.check_cancel()) return std::move(color_array);
|
||||
switch (node.type) {
|
||||
// Color direct string descendants, e.g. 'for' and 'in'.
|
||||
case symbol_while_header:
|
||||
|
@ -1297,6 +1298,8 @@ highlighter_t::color_array_t highlighter_t::highlight() {
|
|||
// Must be an argument with source.
|
||||
if (node.type != symbol_argument || !node.has_source()) continue;
|
||||
|
||||
if (ctx.check_cancel()) return std::move(color_array);
|
||||
|
||||
// Underline every valid path.
|
||||
if (node_is_potential_path(buff, node, ctx.vars, working_directory)) {
|
||||
// It is, underline it.
|
||||
|
|
Loading…
Reference in a new issue