aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/runtime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 4b27067fb8..964e2d0933 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -1926,8 +1926,8 @@ static void cmd_source_buffer(const exarg_T *const eap)
.buf = ga.ga_data,
.offset = 0,
};
- if (curbuf->b_fname
- && path_with_extension(curbuf->b_fname, "lua")) {
+ if (strequal(curbuf->b_p_ft, "lua")
+ || (curbuf->b_fname && path_with_extension(curbuf->b_fname, "lua"))) {
nlua_source_using_linegetter(get_str_line, (void *)&cookie, ":source (no file)");
} else {
source_using_linegetter((void *)&cookie, get_str_line, ":source (no file)");