4

When the title of a document open in a tab is beyond about 25 characters, it gets shortened by replacing some of its name with ...

Is there a way to lower this threshold or change how this functionality works? Alternatively, is there any way to just make the tabs not as wide as they are?

Most of my horizontal space in Geany's tab bar is lost to a handful of .txt files long file names. I'd rather the big ones take up much less room.

mashuptwice
  • 3,395
J. Mini
  • 282

1 Answers1

1

Looks like it is hard coded at length 30, this is a code excerpt from https://github.com/geany/geany/blob/master/src/document.c:

gchar *document_get_basename_for_display(GeanyDocument *doc, gint length)
{
    gchar *base_name, *short_name;
g_return_val_if_fail(doc != NULL, NULL);

if (length < 0)
    length = 30;

base_name = g_path_get_basename(DOC_FILENAME(doc));
short_name = utils_str_middle_truncate(base_name, (guint)length);

g_free(base_name);

return short_name;

}

void document_update_tab_label(GeanyDocument doc) { gchar short_name; GtkWidget *parent;

g_return_if_fail(doc != NULL);

short_name = document_get_basename_for_display(doc, -1);

/* we need to use the event box for the tooltip, labels don't get the necessary events */
parent = gtk_widget_get_parent(doc->priv->tab_label);
parent = gtk_widget_get_parent(parent);

gtk_label_set_text(GTK_LABEL(doc->priv->tab_label), short_name);

gtk_widget_set_tooltip_text(parent, DOC_FILENAME(doc));

g_free(short_name);

}

you can see the first call like this document_get_basename_for_display(doc, -1); which is the actual function that is run when displaying file names. that -1 should be replaced with a config file reference. Maybe make an issue on their github. or fork it and make the change yourself.

paxamus
  • 174