From 4ae3d291848a8a0354f8ed3ff80b64e139f70295 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Fri, 10 Jan 2020 23:18:42 +0100
Subject: [PATCH] Do not require trailing newline in config file #586.

---
 CHANGELOG.md | 2 ++
 src/ex.c     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d49fbfc..300f29c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 ### Added
 * The new env variable `$VIMB_SELECTION` is set to the current selected text
   whenever a `shellcmd` is run #592.
+### Fixed
+* Fixed ignored last line in config file if this line did not end in newline.
 ### Removed
 * Expansion of `%` to the current opened URI for `:shellcmd` was removed
   because it breaks the `x-hint-command` with URIs containing '%'. But it is
diff --git a/src/ex.c b/src/ex.c
index acf233c..c296c62 100644
--- a/src/ex.c
+++ b/src/ex.c
@@ -477,7 +477,7 @@ VbCmdResult ex_run_file(Client *c, const char *filename)
         return res;
     }
 
-    length = g_strv_length(lines) - 1;
+    length = g_strv_length(lines);
     for (i = 0; i < length; i++) {
         line = lines[i];
         /* skip commented or empty lines */
-- 
2.20.1