From 33ae820b9428b4688d35fc2e3a937c0dbc4e3d84 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sat, 28 Dec 2019 05:19:34 +0100 Subject: [PATCH] Move default_settings creation out of try block --- modules/vim/module.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/vim/module.py b/modules/vim/module.py index 6b7d281..45f2a57 100644 --- a/modules/vim/module.py +++ b/modules/vim/module.py @@ -67,15 +67,16 @@ class VimModule(AbstractModule): for plugin in selected_plugins: vimrc_content.insert(index, self.plugins[plugin] + "\n") - default_settings.reverse() - for setting in default_settings: - vimrc_content.insert(index - 1, setting + "\n") except ValueError: vimrc_content.append("call plug#begin('~/.vim/plugged')\n") for element in selected_plugins: vimrc_content.append(self.plugins[element] + "\n") vimrc_content.append("call plug#end()\n") + default_settings.reverse() + for setting in default_settings: + vimrc_content.insert(0, setting + "\n") + seen = set() seen_add = seen.add vimrc_content = [x1 for x1 in vimrc_content if not (x1 in seen or seen_add(x1))]