diff options
author | pommicket <pommicket@gmail.com> | 2023-03-02 09:53:11 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-03-02 09:53:11 -0500 |
commit | 595cc50b7985ec67c49c6e2ffc649cb04692a318 (patch) | |
tree | 970ab71aadabc9f0f0a7a1634512c31aedd23188 /command.c | |
parent | 6d9ebc8332b6cc54ada4bc17689e4de4040892c6 (diff) |
dynamic language registration working
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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: |