summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-04-20 14:51:50 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2021-04-20 14:51:50 -0400
commita57a9682e74ff3609acb2ca6697fc6fa94c23fb6 (patch)
treebbe848dd7e5c7ae259fbcfdf3253240bc564c8d8 /buffer.c
parentf90d98c3c451aa5be2979ff05863b5aa8bee9336 (diff)
:set-language, various other little things
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 7e59e06..1e8e697 100644
--- a/buffer.c
+++ b/buffer.c
@@ -250,6 +250,8 @@ static inline Settings const *buffer_settings(TextBuffer *buffer) {
// what programming language is this?
Language buffer_language(TextBuffer *buffer) {
+ if (buffer->manual_language >= 1 && buffer->manual_language <= LANG_COUNT)
+ return (Language)(buffer->manual_language - 1);
Settings const *settings = buffer_settings(buffer);
char const *filename = buffer->filename;
if (!filename)