Add setting for hiding the status_bar.cursor_position_button (#36288)

Release Notes:

- Added an option for the status_bar.cursor_position_button. Setting to
`false` will hide the button. It defaults to `true`.

This builds off the recent work to hide the language selection button
(https://github.com/zed-industries/zed/pull/33977). I tried to follow
that pattern, and to pick a clear name for the option, but any
feedback/change is welcome.

---------

Co-authored-by: zumbalogy <3770982+zumbalogy@users.noreply.github.com>
This commit is contained in:
zumbalogy 2025-08-16 08:19:38 +02:00 committed by GitHub
parent e664a9bc48
commit f5f14111ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 2 deletions

View file

@ -1,4 +1,4 @@
use editor::{Editor, MultiBufferSnapshot};
use editor::{Editor, EditorSettings, MultiBufferSnapshot};
use gpui::{App, Entity, FocusHandle, Focusable, Subscription, Task, WeakEntity};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@ -209,6 +209,13 @@ impl CursorPosition {
impl Render for CursorPosition {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
if !EditorSettings::get_global(cx)
.status_bar
.cursor_position_button
{
return div();
}
div().when_some(self.position, |el, position| {
let mut text = format!(
"{}{FILE_ROW_COLUMN_DELIMITER}{}",