Text Editor: Always show the position box
Currently the position box ("Ln NNN, Col NNN" on the right side of the header bar) is only shown when "Show Line Numbers" is enabled. I think it's useful to always show the position box. Also when "Show Line Numbers" is disabled.
- to be able to see at a glance which line and column the cursor is on
- this can be useful information even when not editing source code
- the position box is not distracting because the text is light gray
- having line numbers on each line, as now required to see the position, is more distracting when not needed
I think it looks clean and not distracting with the position box always shown, and adds useful information to the editor window. This is similar to how in, for example, gedit and geany the position is shown on the status bar.
Screenshots
To illustrate from top to bottom: with "Show Line Numbers" disabled, with "Show Line Numbers" enabled, and the proposed new look for "Show Line Numbers" disabled.
Implementation
It can be implemented with 2 changes to the file https://gitlab.gnome.org/GNOME/gnome-text-editor/-/blob/main/src/editor-window.c.
In editor_window_notify_selected_page_cb () this code:
gtk_widget_set_visible (GTK_WIDGET (self->position_box),
page && g_settings_get_boolean (self->settings, "show-line-numbers"));
would be changed to (or however to properly cast page
to gboolean):
gtk_widget_set_visible (GTK_WIDGET (self->position_box), page && TRUE);
And in update_subtitle_visibility_cb () this code:
gtk_widget_set_visible (GTK_WIDGET (self->position_box),
visible && g_settings_get_boolean (self->settings, "show-line-numbers"));
would be changed to:
gtk_widget_set_visible (GTK_WIDGET (self->position_box), visible);