You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix-plus/helix-term
Gokul Soumya 5c810e5e52
Fix bug with auto replacing components in compositor (#1711)
* Fix bug with auto replacing components in compositor

This was last known to be working with 5995568c at the
time of commit, but now doesn't work with latest rust
stable.

The issue probably stems from using
std::any::type_name() for finding a component in the
compositor, for which the docs explicitly warn against
considering it as a unique identifier for types.

`replace_or_push()` takes a boxed `Component` and
passes it to `find_id()` which compares this with a
bare Component. `type_name()` returns `Box<T>` for
the former and `T` for latter and we have a false
negative. This has been solved by using a generics
instead of trait objects to pass in a `T: Component`
and then use it for comparison.

I'm not exactly sure how this worked fine at the
time of commit of 5995568c; maybe the internal
implementation of `type_name()` changed to properly
indicate indirection with Box.

* Do not compare by type name in compositor find_id
2 years ago
..
src Fix bug with auto replacing components in compositor (#1711) 2 years ago
.gitignore Initial import. 4 years ago
Cargo.toml Merge remote-tracking branch 'origin/master' into debug 2 years ago
build.rs filter git revision on git command success exit code (#1674) 2 years ago