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.
master
Benno Schulenberg 2021-11-17 10:25:32 +01:00
parent 3b5f650621
commit 2b0bcc7cee
1 changed files with 7 additions and 0 deletions

View File

@ -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;