--- D:\Install\meld_1.7\meld_original\meld\filediff.py
+++ D:\Install\meld_1.7\meld\meld\filediff.py
@@ -861,7 +861,7 @@
         pane = self._get_focused_pane()
         if pane >= 0:
             if self.textbuffer[pane].data.filename:
-                self._open_files([self.textbuffer[pane].data.filename])
+                self._open_files([self.textbuffer[pane].data.filename], self.cursor.line + 1)
 
     def get_selected_text(self):
         """Returns selected text of active pane"""



--- D:\Install\meld_1.7\meld_original\meld\melddoc.py
+++ D:\Install\meld_1.7\meld\meld\melddoc.py
@@ -76,7 +76,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,8 +98,9 @@
             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"):
-                    editor = self.prefs.get_editor_command([path])
+                # 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], line)
                     if editor:
                         subprocess.Popen(editor)
                     else:



--- D:\Install\meld_1.7\meld_original\meld\preferences.py
+++ D:\Install\meld_1.7\meld\meld\preferences.py
@@ -20,6 +20,7 @@
 from gettext import gettext as _
 
 import gtk
+import re
 
 from . import filters
 from . import misc
@@ -366,9 +367,19 @@
         }
         return toolbar_styles[style]
 
-    def get_editor_command(self, files):
+    def get_editor_command(self, files, line=0):
         if self.edit_command_type == "custom":
-            return self.edit_command_custom.split() + files
+            custom_command = self.edit_command_custom
+            matches = re.search('(?P<editor>.+)(?:\s+)(?P<param>.*)', custom_command)
+            if matches:
+                # first part is the editor itself
+                custom_command = matches.group('editor')
+                # second part may contain optional parameters
+                # if it contains "{file}" than process it and modify files array
+                if matches.group('param').count('{file}') > 0:
+                    files[0] = matches.group('param').replace("{file}", files[0])
+                    files[0] = files[0].replace("{line}", str(line))
+            return [custom_command] + files
         else:
             if not hasattr(self, "_gconf"):
                 return []
