-
Notifications
You must be signed in to change notification settings - Fork 55
feat: allow setting mouse SelectionMode on webgl2 backend
#143
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
Conversation
src/backend/webgl2.rs
Outdated
| /// | ||
| /// This setting only applies when mouse selection is enabled via | ||
| /// [`enable_mouse_selection()`](Self::enable_mouse_selection). | ||
| pub fn selection_mode(mut self, mode: SelectionMode) -> Self { |
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 a single function is more ergonomic, i suggest deprecating enable_mouse_selection():
#[deprecated(note = "use `enable_copy_on_mouse_selection` instead", since = "0.3.0")]
pub fn enable_mouse_selection(self) -> Self {
self.enable_copy_on_mouse_selection(SelectionMode::default())
}
/// ...
pub fn enable_copy_on_mouse_selection(mut self, mode: SelectionMode) -> Self {
self.clipboard_selection = Some(mode);
self
}(enable_copy_on_mouse_selection is just what i had locally, when attempting to come up with a good replacement for enable_mouse_selection())
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 it not possible to make auto copy optional/configurable? if i read correctly, the default handler doesn't copy on select, you need to ctrl/cmd+c it
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.
beamterm does copy-on-select; it was deemed the most straightforward solution, and avoids needing to come up with a sensible default shortcut (follow browser/os conventions or terminal conventions? which terminal's conventions?).
7781a88 to
136dd95
Compare
src/backend/webgl2.rs
Outdated
|
|
||
| /// Enables mouse text selection with the specified selection mode. | ||
| /// | ||
| /// Selected text can be copied to clipboard with Ctrl+C (Cmd+C on macOS). |
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.
can just remove this line, methinks
498c67d to
970a2b3
Compare
orhun
left a comment
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.
LGTM!
SelectionMode on webgl2 backendSelectionMode on webgl2 backend
|
🍪 |
No description provided.