<p>In <a href="https://github.com/geany/geany/pull/527#discussion_r67615008">src/ui_utils.c</a>:</p>
<pre style='color:#555'>> +void ui_update_menu_eol(GeanyDocument *doc)
> +{
> + gint eol = sci_get_eol_mode(doc->editor->sci);
> + const gchar *widget_name;
> +
> + switch (eol)
> + {
> + case SC_EOL_CR: widget_name = "cr"; break;
> + case SC_EOL_LF: widget_name = "lf"; break;
> + default: widget_name = "crlf"; break;
> + }
> + gtk_check_menu_item_set_active(
> + GTK_CHECK_MENU_ITEM(ui_lookup_widget(main_widgets.window, widget_name)), TRUE);
> +
> + ui_update_statusbar(doc, -1);
> +}
</pre>
<p>is splitting this out of <code>ui_document_show_hide()</code> worth it? It's a mere optimization IIUC, but it requires the caller to play with <code>ignore_callback</code>, and it calls <code>ui_update_statusbar()</code> which wasn't done previously in <code>ui_document_show_hide()</code>, so many callers do both themselves.</p>
<p>So my question is, why not simply call <code>ui_document_show_hide()</code> from the undo stuff, and not care about it updating more than it needs to?</p>
<p>BTW, if we want to be able to nest calls playing with <code>ignore_callback</code>, we could make it an integer and <code>++</code> and <code>--</code> it instead of setting to absolute <code>TRUE</code>/<code>FALSE</code>. Though ideally one day we get rid of that odd global.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/527/files/6a2422af3226738247284ef8f1154a8e23bfca9f#r67615008">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/ABDrJzA8F2nI9fl8UmIixe-bgHlSmIx0ks5qNSMTgaJpZM4FJSj5">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ7OB7IF4SL4-3sWrOyakNLIxmUolks5qNSMTgaJpZM4FJSj5.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/geany/geany/pull/527/files/6a2422af3226738247284ef8f1154a8e23bfca9f#r67615008"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>