dgkf / dgkf/R

Update continuation prompt color

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
meta-good first issue type-enhancement
Dominant language
Rust
Stars
145
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Currently, the continuation prompt (the repl prompt for expressions that span multiple lines) is a bright blue `:`, but it would be preferred if it was a bit more subtle. Preferably the same color as the first-line prompt.

[Following changes to `reedline`](https://github.com/nushell/reedline/pull/531), we can now customize the color of this prompt. First and foremost, adding this functionality will require bumping the version of `reedline`, which will require updating some code to accommodate `reedline`'s move from using `crossterm::style::Color` to `reedline::Color` (a reexport, as I think they're preparing to remove the `crossterm::style::Color` dependency).

Like the other prompt color style configurations, this one requires that we [implement a trait method](https://github.com/nushell/reedline/blob/79778f7b85ddd5ad67ccb8c615518d3dcefdc7ed/src/prompt/base.rs#L104-L107).

Similar to how these colors are configured via `Prompt` trait methods,

https://github.com/dgkf/R/blob/a902965d259ca554851ddbf78d76744773d77abe/src/r_repl/prompt.rs#L56-L60

A new method will need to be added to determine the continuation prompt:

```rust
pub trait Prompt: Send {
fn get_prompt_multiline_color(&self) -> nu_ansi_term::Color {
}
}
```

Note that unlike the other `get_*_color` methods in the `Prompt` trait which return a `crossterm::style::Color`, this method returns a `nu_ansi_term::Color`. This is just an artifact of `reedterm` being mid-transition to using `crossterm::style::Color`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.