summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
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)