From a57a9682e74ff3609acb2ca6697fc6fa94c23fb6 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Tue, 20 Apr 2021 14:51:50 -0400 Subject: :set-language, various other little things --- buffer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'buffer.c') 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) -- cgit v1.2.3