--- D:\Install\meld_1.7\meld_original\meld\melddoc.py
+++ D:\Install\meld_1.7\meld\meld\melddoc.py
@@ -18,6 +18,7 @@
 
 
 import os
+import re
 import subprocess
 import sys
 
@@ -76,7 +77,7 @@
         if self.scheduler.tasks_pending():
             self.scheduler.remove_task(self.scheduler.get_current_task())
 
-    def _open_files(self, selected):
+    def _open_files(self, selected, line=0):
         query_attrs = ",".join((gio.FILE_ATTRIBUTE_STANDARD_TYPE,
                                 gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE))
 
@@ -98,9 +99,19 @@
             elif file_type == gio.FILE_TYPE_REGULAR:
                 content_type = info.get_content_type()
                 path = source.get_path()
-                if gio.content_type_is_a(content_type, "text/plain"):
+                # content_type_is_a does not seem to work on windows
+                if gio.content_type_is_a(content_type, "text/plain") or sys.platform == "win32":
                     editor = self.prefs.get_editor_command([path])
                     if editor:
+                        commandline = re.search('(?P<editor>.+)(?:\s+)(?P<param>.*)', editor[0])
+                        if commandline:
+                        # first part is the editor itself
+                            editor[0] = commandline.group('editor')
+                            # second part may contain optional parameters
+                            # if it contains $file than process it
+                            if commandline.group('param').count('$file') > 0:
+                                editor[1] = commandline.group('param').replace("$file", editor[1])
+                                editor[1] = editor[1].replace("$line", str(line))
                         subprocess.Popen(editor)
                     else:
                         os_open(path)
