Commits

Anonymous committed d452bcd

Not finishing multiline configs after a blank line

  • Participants
  • Parent commits 638e68b

Comments (0)

Files changed (2)

File ropemacs/dialog.py

     result = []
     multiline = False
     for line in sets.splitlines(True):
-        if line[0].isspace() and multiline:
-            result[-1][1] += line[1:]
+        if line[0].isspace():
+            if multiline:
+                result[-1][1] += line[1:]
         else:
-            if not line:
+            if not line.strip():
                 continue
             multiline= False
             tokens = line.split(None, 1)
             value = ''
             if len(tokens) > 1:
                 result.append([tokens[0], tokens[1].rstrip('\r\n')])
-            elif len(tokens) > 0:
+            else:
                 multiline = True
                 result.append([tokens[0], ''])
     return dict(result)

File ropemacstest.py

             ['batchset', '\nname1\n value1\n\nname2 value2\n\n', 'done'])
         action, result = dialog.show_dialog(minibuffer, ['done', 'cancel'],
                                             optionals=optionals)
-        self.assertEquals(
-            {'name1': 'value1\n', 'name2': 'value2'}, result)
+        self.assertEquals({'name1': 'value1\n', 'name2': 'value2'}, result)
         self.assertEquals('done', action)
 
     def test_skip_initial_asking(self):