summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/buffer.c b/buffer.c
index e1498ef..a4eeab6 100644
--- a/buffer.c
+++ b/buffer.c
@@ -243,16 +243,11 @@ static inline Font *buffer_font(TextBuffer *buffer) {
return buffer->ted->font;
}
-// Get the settings used for this buffer.
-static inline Settings const *buffer_settings(TextBuffer *buffer) {
- return &buffer->ted->settings;
-}
-
// 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);
+ Settings const *settings = buffer->ted->settings;
char const *filename = buffer->filename;
if (!filename)
return LANG_NONE;
@@ -277,6 +272,12 @@ Language buffer_language(TextBuffer *buffer) {
return LANG_NONE;
}
+// Get the settings used for this buffer.
+Settings *buffer_settings(TextBuffer *buffer) {
+ return &buffer->ted->settings_by_language[buffer_language(buffer)];
+}
+
+
// NOTE: this string will be invalidated when the line is edited!!!
// only use it briefly!!
static String32 buffer_get_line(TextBuffer *buffer, u32 line_number) {