From 2b0bcc7ceed899dc228931c9d4d8619e4e0fb599 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 17 Nov 2021 10:25:32 +0100 Subject: [PATCH] feedback: show a relevant message for M-O when the syntax has 'tabgives' When the syntax contains a 'tabgives' command, toggling the conversion of tabs-to-spaces has no effect -- not for the current file. So, tell the user that and don't change the flag. This fixes https://savannah.gnu.org/bugs/?61496. Bug existed since version 4.5, since 'tabgives' was introduced. --- src/nano.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nano.c b/src/nano.c index bba7142c..dbc5828d 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1086,6 +1086,13 @@ void toggle_this(int flag) openfile->firstcolumn = 0; refresh_needed = TRUE; break; + case TABS_TO_SPACES: + if (openfile->syntax && openfile->syntax->tab) { + statusline(AHEM, _("Current syntax determines Tab")); + TOGGLE(flag); + return; + } + break; case WHITESPACE_DISPLAY: titlebar(NULL); refresh_needed = TRUE;