From 4b4265177c063799fe52e4bad44b8c697f12a9df Mon Sep 17 00:00:00 2001 From: Wade Brainerd Date: Sun, 6 Nov 2016 20:38:01 -0500 Subject: [PATCH] Fix for delimiter detection with unsaved file --- csvplugin.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/csvplugin.py b/csvplugin.py index 58e6295..6698a0a 100644 --- a/csvplugin.py +++ b/csvplugin.py @@ -91,11 +91,12 @@ def GetViewSetting(self, name, default): def DetermineDelimiter(self): filename = self.view.file_name() - self.delimiter_mapping = self.settings.get('delimiter_mapping', {}) - for k, v in self.delimiter_mapping.items(): - if fnmatch.fnmatch(filename, k): - self.delimiter = v - return + if filename: + self.delimiter_mapping = self.settings.get('delimiter_mapping', {}) + for k, v in self.delimiter_mapping.items(): + if fnmatch.fnmatch(filename, k): + self.delimiter = v + return self.delimiter = self.GetViewSetting('delimiter', ',')