summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/command.c b/command.c
index 775d6bc..e9af9c3 100644
--- a/command.c
+++ b/command.c
@@ -411,10 +411,10 @@ void command_execute(Ted *ted, Command c, i64 argument) {
case CMD_SET_LANGUAGE:
if (buffer && !buffer->is_line_buffer) {
- if (argument < 0 || argument >= LANG_COUNT_MAX)
- buffer->manual_language = -1;
+ if (argument <= 0 || argument > LANG_USER_MAX || !language_is_valid((Language)argument))
+ buffer->manual_language = 0;
else
- buffer->manual_language = (i16)(argument + 1);
+ buffer->manual_language = argument;
}
break;
case CMD_AUTOCOMPLETE: