Anonymous avatar Anonymous committed d452bcd

Not finishing multiline configs after a blank line

Comments (0)

Files changed (2)

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)
             ['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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.