-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
move ui and commands to helix-view #5581
Conversation
7c80092
to
e8d440e
Compare
e8d440e
to
52570e7
Compare
@archseer I kept this PR minimal on purpose so right now it doesn't hide terminal specific code behind cfg attributes. I wasn't 100% sure what the best way to do that would be and wanted to leave that design space for when we actually implement guis. This PR already unblocks the non-gui related work. Are you okay with that or do you want me to add the cfg attributes in this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple really small nits otherwise looks good, though I assume this would need a rebase so no worries if this review isn't that helpful
/// Render the component onto the provided surface. | ||
fn render(&mut self, area: Rect, frame: &mut Surface, ctx: &mut Context); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this reorder necessary
@@ -264,14 +264,14 @@ impl Markdown { | |||
CodeBlockKind::Fenced(language) => language, | |||
CodeBlockKind::Indented => "", | |||
}; | |||
let tui_text = highlighted_code_block( | |||
let helix_tui_text = highlighted_code_block( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and the one below don't need to be changed
let helix_tui_text = highlighted_code_block( | |
let tui_text = highlighted_code_block( |
text.to_string(), | ||
language, | ||
theme, | ||
Arc::clone(&self.config_loader), | ||
None, | ||
); | ||
lines.extend(tui_text.lines.into_iter()); | ||
lines.extend(helix_tui_text.lines.into_iter()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lines.extend(helix_tui_text.lines.into_iter()); | |
lines.extend(tui_text.lines.into_iter()); |
|
||
# TODO: graphics.rs tests rely on this, but we should remove that | ||
# [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] | ||
# helix-tui = { path = "../helix-tui" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all our cargo.tomls have newlines at the end
# helix-tui = { path = "../helix-tui" } | |
# helix-tui = { path = "../helix-tui" } | |
@@ -28,7 +28,7 @@ path = "src/main.rs" | |||
|
|||
[dependencies] | |||
helix-core = { version = "0.6", path = "../helix-core" } | |||
helix-view = { version = "0.6", path = "../helix-view" } | |||
helix-view = { version = "0.6", path = "../helix-view", features = ["term"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helix-view = { version = "0.6", path = "../helix-view", features = ["term"]} | |
helix-view = { version = "0.6", path = "../helix-view", features = ["term"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple really small nits otherwise looks good, though I assume this would need a rebase so no worries if this review isn't that helpful
I think I want to go with a slightly different approach here, this branch also has an insane amount of conflicts so I need to start over anyway. I will close this |
Closes #5555
This PR is super simple. All it does is:
helix-view
helix_term::
withcrate::
helix_view::
withcrate::
(unfortunate that rust doesn't allow this)tui::
withhelix_tui::
(seems more consistent, but the main reason is that RA for some reason is unable to resolve these imports evenotugh rustc can which leads to terrible dev experience)helix-term
that are used by commandsThe primary focus of this PR is to avoid git conflicts. Git should handle most of these changes fine if a PR is rebased
altough there can be some conflicts in the
use
statements. However, compared to other PRs the changes here are notthat large and should be easy to resolve.
These changes will not only allow experimentation with GUIs (#39) but also unblocks other efforts (see #5555).
However, this PR implements not abstraction over the actual terminal functionality yet.
I think the best approach would be a
cfg
based approach opposed to traits as used by @archser in thegui
branch.Such an approach avoids many breaking changes (and making every function/struct generic).
This abstraction can be added in the future with smaller less disruptive PRs.