We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support neovim (`nvim`) as an editor
```
[WARNING][14:15:54] The editor "nvim" is unknown to coala. Files won't be opened at the correct positions and other quirks might occur. Consider opening an issue at https://github.com/coala/coala/issues so we can add support for this editor. Supported editors are: atom, emacs, emacsclient, geany, gedit, gvim, kate, nano, subl, vim, xed
```

It's basically the same as `vim` so it could be just added to the allowed editors list and given the same behavior as `vim`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `coalib/results/result_actions/OpenEditorAction.py`
Content:
```
1 import logging
2 import shlex
3 import subprocess
4 from os.path import exists
5 from os import environ
6 
7 from coalib.results.Diff import Diff
8 from coalib.results.Result import Result
9 from coalib.results.result_actions.ResultAction import ResultAction
10 from coala_utils.decorators import enforce_signature
11 
12 
13 """
14 Data about all text editors coala knows about. New editors
15 can just be added here.
16 For each editor the following info is stored:
17 {
18     <name/comand>: {
19         "file_arg_template":
20             A string used to generate arguments to open a file.
21             Must at least have the placeholder 'filename'
22             and can optionally use 'line' and 'column'
23             to open the file at the correct position.
24             Some editors don't support opening files at
25             a certain position if multiple files are
26             to be opened, but we try to do so anyway.
27         "args":
28             General arguments added to the call, e.g. to
29             force opening of a new window.
30         "gui":
31             Boolean. True if this is a gui editor.
32             Optional, defaults to False.
33     }
34 }
35 """
36 KNOWN_EDITORS = {
37     # non-gui editors
38     'vim': {
39         'file_arg_template': '{filename} +{line}',
40         'gui': False
41     },
42     'nano': {
43         'file_arg_template': '+{line},{column} {filename} ',
44         'gui': False
45     },
46     'emacs': {
47         'file_arg_template': '+{line}:{column} {filename}',
48         'gui': False
49     },
50     'emacsclient': {
51         'file_arg_template': '+{line}:{column} {filename}',
52         'gui': False
53     },
54 
55     # gui editors
56     'atom': {
57         'file_arg_template': '{filename}:{line}:{column}',
58         'args': '--wait',
59         'gui': True
60     },
61     'geany': {
62         'file_arg_template': '{filename} -l {line} --column {column}',
63         'args': '-s -i',
64         'gui': True
65     },
66     'gedit': {
67         'file_arg_template': '{filename} +{line}',
68         'args': '-s',
69         'gui': True
70     },
71     'gvim': {
72         'file_arg_template': '{filename} +{line}',
73         'gui': True
74     },
75     'kate': {
76         'file_arg_template': '{filename} -l {line} -c {column}',
77         'args': '--new',
78         'gui': True
79     },
80     'subl': {
81         'file_arg_template': '{filename}:{line}:{column}',
82         'args': '--wait',
83         'gui': True
84     },
85     'xed': {
86         'file_arg_template': '{filename} +{line}',
87         'args': '--new-window',
88         'gui': True
89     },
90 }
91 
92 
93 class OpenEditorAction(ResultAction):
94 
95     SUCCESS_MESSAGE = 'Changes saved successfully.'
96 
97     @staticmethod
98     @enforce_signature
99     def is_applicable(result: Result, original_file_dict, file_diff_dict):
100         """
101         For being applicable, the result has to point to a number of files
102         that have to exist i.e. have not been previously deleted.
103         """
104 
105         if not len(result.affected_code) > 0:
106             return 'The result is not associated with any source code.'
107 
108         filenames = set(src.renamed_file(file_diff_dict)
109                         for src in result.affected_code)
110         if not all(exists(filename) for filename in filenames):
111             return ("The result is associated with source code that doesn't "
112                     'seem to exist.')
113         return True
114 
115     def build_editor_call_args(self, editor, editor_info, filenames):
116         """
117         Create argument list which will then be used to open an editor for
118         the given files at the correct positions, if applicable.
119 
120         :param editor:
121             The editor to open the file with.
122         :param editor_info:
123             A dict containing the keys ``args`` and ``file_arg_template``,
124             providing additional call arguments and a template to open
125             files at a position for this editor.
126         :param filenames:
127             A dict holding one entry for each file to be opened.
128             Keys must be ``filename``, ``line`` and ``column``.
129         """
130         call_args = [editor]
131 
132         # for some editors we define extra arguments
133         if 'args' in editor_info:
134             call_args += shlex.split(editor_info['args'])
135 
136         # add info for each file to be opened
137         for file_info in filenames.values():
138             file_arg = editor_info['file_arg_template'].format(
139                 filename=shlex.quote(file_info['filename']),
140                 line=file_info['line'], column=file_info['column']
141             )
142             call_args += shlex.split(file_arg)
143 
144         return call_args
145 
146     def apply(self, result, original_file_dict, file_diff_dict, editor: str):
147         """
148         Open file(s)
149 
150         :param editor: The editor to open the file with.
151         """
152         try:
153             editor_info = KNOWN_EDITORS[editor.strip()]
154         except KeyError:
155             # If the editor is unknown fall back to just passing
156             # the filenames and emit a warning
157             logging.warning(
158                 'The editor "{editor}" is unknown to coala. Files won\'t be'
159                 ' opened at the correct positions and other quirks might'
160                 ' occur. Consider opening an issue at'
161                 ' https://github.com/coala/coala/issues so we'
162                 ' can add support for this editor.'
163                 ' Supported editors are: {supported}'.format(
164                     editor=editor, supported=', '.join(
165                         sorted(KNOWN_EDITORS.keys())
166                     )
167                 )
168             )
169             editor_info = {
170                 'file_arg_template': '{filename}',
171                 'gui': False
172             }
173 
174         # Use dict to remove duplicates
175         filenames = {
176             src.file: {
177                 'filename': src.renamed_file(file_diff_dict),
178                 'line': src.start.line or 1,
179                 'column': src.start.column or 1
180             }
181             for src in result.affected_code
182         }
183 
184         call_args = self.build_editor_call_args(editor, editor_info, filenames)
185 
186         if editor_info.get('gui', True):
187             subprocess.call(call_args, stdout=subprocess.PIPE)
188         else:
189             subprocess.call(call_args)
190 
191         for original_name, file_info in filenames.items():
192             filename = file_info['filename']
193             with open(filename, encoding='utf-8') as file:
194                 file_diff_dict[original_name] = Diff.from_string_arrays(
195                     original_file_dict[original_name], file.readlines(),
196                     rename=False if original_name == filename else filename)
197 
198         return file_diff_dict
199 
200     if 'EDITOR' in environ:
201         apply.__defaults__ = (environ['EDITOR'],)
202
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/coalib/results/result_actions/OpenEditorAction.py b/coalib/results/result_actions/OpenEditorAction.py
--- a/coalib/results/result_actions/OpenEditorAction.py
+++ b/coalib/results/result_actions/OpenEditorAction.py
@@ -39,6 +39,10 @@
         'file_arg_template': '{filename} +{line}',
         'gui': False
     },
+    'nvim': {
+        'file_arg_template': '{filename} +{line}',
+        'gui': False
+    },
     'nano': {
         'file_arg_template': '+{line},{column} {filename} ',
         'gui': False

{"golden_diff": "diff --git a/coalib/results/result_actions/OpenEditorAction.py b/coalib/results/result_actions/OpenEditorAction.py\n--- a/coalib/results/result_actions/OpenEditorAction.py\n+++ b/coalib/results/result_actions/OpenEditorAction.py\n@@ -39,6 +39,10 @@\n         'file_arg_template': '{filename} +{line}',\n         'gui': False\n     },\n+    'nvim': {\n+        'file_arg_template': '{filename} +{line}',\n+        'gui': False\n+    },\n     'nano': {\n         'file_arg_template': '+{line},{column} {filename} ',\n         'gui': False\n", "issue": "Support neovim (`nvim`) as an editor\n```\r\n[WARNING][14:15:54] The editor \"nvim\" is unknown to coala. Files won't be opened at the correct positions and other quirks might occur. Consider opening an issue at https://github.com/coala/coala/issues so we can add support for this editor. Supported editors are: atom, emacs, emacsclient, geany, gedit, gvim, kate, nano, subl, vim, xed\r\n```\r\n\r\nIt's basically the same as `vim` so it could be just added to the allowed editors list and given the same behavior as `vim`.\n", "before_files": [{"content": "import logging\nimport shlex\nimport subprocess\nfrom os.path import exists\nfrom os import environ\n\nfrom coalib.results.Diff import Diff\nfrom coalib.results.Result import Result\nfrom coalib.results.result_actions.ResultAction import ResultAction\nfrom coala_utils.decorators import enforce_signature\n\n\n\"\"\"\nData about all text editors coala knows about. New editors\ncan just be added here.\nFor each editor the following info is stored:\n{\n    <name/comand>: {\n        \"file_arg_template\":\n            A string used to generate arguments to open a file.\n            Must at least have the placeholder 'filename'\n            and can optionally use 'line' and 'column'\n            to open the file at the correct position.\n            Some editors don't support opening files at\n            a certain position if multiple files are\n            to be opened, but we try to do so anyway.\n        \"args\":\n            General arguments added to the call, e.g. to\n            force opening of a new window.\n        \"gui\":\n            Boolean. True if this is a gui editor.\n            Optional, defaults to False.\n    }\n}\n\"\"\"\nKNOWN_EDITORS = {\n    # non-gui editors\n    'vim': {\n        'file_arg_template': '{filename} +{line}',\n        'gui': False\n    },\n    'nano': {\n        'file_arg_template': '+{line},{column} {filename} ',\n        'gui': False\n    },\n    'emacs': {\n        'file_arg_template': '+{line}:{column} {filename}',\n        'gui': False\n    },\n    'emacsclient': {\n        'file_arg_template': '+{line}:{column} {filename}',\n        'gui': False\n    },\n\n    # gui editors\n    'atom': {\n        'file_arg_template': '{filename}:{line}:{column}',\n        'args': '--wait',\n        'gui': True\n    },\n    'geany': {\n        'file_arg_template': '{filename} -l {line} --column {column}',\n        'args': '-s -i',\n        'gui': True\n    },\n    'gedit': {\n        'file_arg_template': '{filename} +{line}',\n        'args': '-s',\n        'gui': True\n    },\n    'gvim': {\n        'file_arg_template': '{filename} +{line}',\n        'gui': True\n    },\n    'kate': {\n        'file_arg_template': '{filename} -l {line} -c {column}',\n        'args': '--new',\n        'gui': True\n    },\n    'subl': {\n        'file_arg_template': '{filename}:{line}:{column}',\n        'args': '--wait',\n        'gui': True\n    },\n    'xed': {\n        'file_arg_template': '{filename} +{line}',\n        'args': '--new-window',\n        'gui': True\n    },\n}\n\n\nclass OpenEditorAction(ResultAction):\n\n    SUCCESS_MESSAGE = 'Changes saved successfully.'\n\n    @staticmethod\n    @enforce_signature\n    def is_applicable(result: Result, original_file_dict, file_diff_dict):\n        \"\"\"\n        For being applicable, the result has to point to a number of files\n        that have to exist i.e. have not been previously deleted.\n        \"\"\"\n\n        if not len(result.affected_code) > 0:\n            return 'The result is not associated with any source code.'\n\n        filenames = set(src.renamed_file(file_diff_dict)\n                        for src in result.affected_code)\n        if not all(exists(filename) for filename in filenames):\n            return (\"The result is associated with source code that doesn't \"\n                    'seem to exist.')\n        return True\n\n    def build_editor_call_args(self, editor, editor_info, filenames):\n        \"\"\"\n        Create argument list which will then be used to open an editor for\n        the given files at the correct positions, if applicable.\n\n        :param editor:\n            The editor to open the file with.\n        :param editor_info:\n            A dict containing the keys ``args`` and ``file_arg_template``,\n            providing additional call arguments and a template to open\n            files at a position for this editor.\n        :param filenames:\n            A dict holding one entry for each file to be opened.\n            Keys must be ``filename``, ``line`` and ``column``.\n        \"\"\"\n        call_args = [editor]\n\n        # for some editors we define extra arguments\n        if 'args' in editor_info:\n            call_args += shlex.split(editor_info['args'])\n\n        # add info for each file to be opened\n        for file_info in filenames.values():\n            file_arg = editor_info['file_arg_template'].format(\n                filename=shlex.quote(file_info['filename']),\n                line=file_info['line'], column=file_info['column']\n            )\n            call_args += shlex.split(file_arg)\n\n        return call_args\n\n    def apply(self, result, original_file_dict, file_diff_dict, editor: str):\n        \"\"\"\n        Open file(s)\n\n        :param editor: The editor to open the file with.\n        \"\"\"\n        try:\n            editor_info = KNOWN_EDITORS[editor.strip()]\n        except KeyError:\n            # If the editor is unknown fall back to just passing\n            # the filenames and emit a warning\n            logging.warning(\n                'The editor \"{editor}\" is unknown to coala. Files won\\'t be'\n                ' opened at the correct positions and other quirks might'\n                ' occur. Consider opening an issue at'\n                ' https://github.com/coala/coala/issues so we'\n                ' can add support for this editor.'\n                ' Supported editors are: {supported}'.format(\n                    editor=editor, supported=', '.join(\n                        sorted(KNOWN_EDITORS.keys())\n                    )\n                )\n            )\n            editor_info = {\n                'file_arg_template': '{filename}',\n                'gui': False\n            }\n\n        # Use dict to remove duplicates\n        filenames = {\n            src.file: {\n                'filename': src.renamed_file(file_diff_dict),\n                'line': src.start.line or 1,\n                'column': src.start.column or 1\n            }\n            for src in result.affected_code\n        }\n\n        call_args = self.build_editor_call_args(editor, editor_info, filenames)\n\n        if editor_info.get('gui', True):\n            subprocess.call(call_args, stdout=subprocess.PIPE)\n        else:\n            subprocess.call(call_args)\n\n        for original_name, file_info in filenames.items():\n            filename = file_info['filename']\n            with open(filename, encoding='utf-8') as file:\n                file_diff_dict[original_name] = Diff.from_string_arrays(\n                    original_file_dict[original_name], file.readlines(),\n                    rename=False if original_name == filename else filename)\n\n        return file_diff_dict\n\n    if 'EDITOR' in environ:\n        apply.__defaults__ = (environ['EDITOR'],)\n", "path": "coalib/results/result_actions/OpenEditorAction.py"}], "after_files": [{"content": "import logging\nimport shlex\nimport subprocess\nfrom os.path import exists\nfrom os import environ\n\nfrom coalib.results.Diff import Diff\nfrom coalib.results.Result import Result\nfrom coalib.results.result_actions.ResultAction import ResultAction\nfrom coala_utils.decorators import enforce_signature\n\n\n\"\"\"\nData about all text editors coala knows about. New editors\ncan just be added here.\nFor each editor the following info is stored:\n{\n    <name/comand>: {\n        \"file_arg_template\":\n            A string used to generate arguments to open a file.\n            Must at least have the placeholder 'filename'\n            and can optionally use 'line' and 'column'\n            to open the file at the correct position.\n            Some editors don't support opening files at\n            a certain position if multiple files are\n            to be opened, but we try to do so anyway.\n        \"args\":\n            General arguments added to the call, e.g. to\n            force opening of a new window.\n        \"gui\":\n            Boolean. True if this is a gui editor.\n            Optional, defaults to False.\n    }\n}\n\"\"\"\nKNOWN_EDITORS = {\n    # non-gui editors\n    'vim': {\n        'file_arg_template': '{filename} +{line}',\n        'gui': False\n    },\n    'nvim': {\n        'file_arg_template': '{filename} +{line}',\n        'gui': False\n    },\n    'nano': {\n        'file_arg_template': '+{line},{column} {filename} ',\n        'gui': False\n    },\n    'emacs': {\n        'file_arg_template': '+{line}:{column} {filename}',\n        'gui': False\n    },\n    'emacsclient': {\n        'file_arg_template': '+{line}:{column} {filename}',\n        'gui': False\n    },\n\n    # gui editors\n    'atom': {\n        'file_arg_template': '{filename}:{line}:{column}',\n        'args': '--wait',\n        'gui': True\n    },\n    'geany': {\n        'file_arg_template': '{filename} -l {line} --column {column}',\n        'args': '-s -i',\n        'gui': True\n    },\n    'gedit': {\n        'file_arg_template': '{filename} +{line}',\n        'args': '-s',\n        'gui': True\n    },\n    'gvim': {\n        'file_arg_template': '{filename} +{line}',\n        'gui': True\n    },\n    'kate': {\n        'file_arg_template': '{filename} -l {line} -c {column}',\n        'args': '--new',\n        'gui': True\n    },\n    'subl': {\n        'file_arg_template': '{filename}:{line}:{column}',\n        'args': '--wait',\n        'gui': True\n    },\n    'xed': {\n        'file_arg_template': '{filename} +{line}',\n        'args': '--new-window',\n        'gui': True\n    },\n}\n\n\nclass OpenEditorAction(ResultAction):\n\n    SUCCESS_MESSAGE = 'Changes saved successfully.'\n\n    @staticmethod\n    @enforce_signature\n    def is_applicable(result: Result, original_file_dict, file_diff_dict):\n        \"\"\"\n        For being applicable, the result has to point to a number of files\n        that have to exist i.e. have not been previously deleted.\n        \"\"\"\n\n        if not len(result.affected_code) > 0:\n            return 'The result is not associated with any source code.'\n\n        filenames = set(src.renamed_file(file_diff_dict)\n                        for src in result.affected_code)\n        if not all(exists(filename) for filename in filenames):\n            return (\"The result is associated with source code that doesn't \"\n                    'seem to exist.')\n        return True\n\n    def build_editor_call_args(self, editor, editor_info, filenames):\n        \"\"\"\n        Create argument list which will then be used to open an editor for\n        the given files at the correct positions, if applicable.\n\n        :param editor:\n            The editor to open the file with.\n        :param editor_info:\n            A dict containing the keys ``args`` and ``file_arg_template``,\n            providing additional call arguments and a template to open\n            files at a position for this editor.\n        :param filenames:\n            A dict holding one entry for each file to be opened.\n            Keys must be ``filename``, ``line`` and ``column``.\n        \"\"\"\n        call_args = [editor]\n\n        # for some editors we define extra arguments\n        if 'args' in editor_info:\n            call_args += shlex.split(editor_info['args'])\n\n        # add info for each file to be opened\n        for file_info in filenames.values():\n            file_arg = editor_info['file_arg_template'].format(\n                filename=shlex.quote(file_info['filename']),\n                line=file_info['line'], column=file_info['column']\n            )\n            call_args += shlex.split(file_arg)\n\n        return call_args\n\n    def apply(self, result, original_file_dict, file_diff_dict, editor: str):\n        \"\"\"\n        Open file(s)\n\n        :param editor: The editor to open the file with.\n        \"\"\"\n        try:\n            editor_info = KNOWN_EDITORS[editor.strip()]\n        except KeyError:\n            # If the editor is unknown fall back to just passing\n            # the filenames and emit a warning\n            logging.warning(\n                'The editor \"{editor}\" is unknown to coala. Files won\\'t be'\n                ' opened at the correct positions and other quirks might'\n                ' occur. Consider opening an issue at'\n                ' https://github.com/coala/coala/issues so we'\n                ' can add support for this editor.'\n                ' Supported editors are: {supported}'.format(\n                    editor=editor, supported=', '.join(\n                        sorted(KNOWN_EDITORS.keys())\n                    )\n                )\n            )\n            editor_info = {\n                'file_arg_template': '{filename}',\n                'gui': False\n            }\n\n        # Use dict to remove duplicates\n        filenames = {\n            src.file: {\n                'filename': src.renamed_file(file_diff_dict),\n                'line': src.start.line or 1,\n                'column': src.start.column or 1\n            }\n            for src in result.affected_code\n        }\n\n        call_args = self.build_editor_call_args(editor, editor_info, filenames)\n\n        if editor_info.get('gui', True):\n            subprocess.call(call_args, stdout=subprocess.PIPE)\n        else:\n            subprocess.call(call_args)\n\n        for original_name, file_info in filenames.items():\n            filename = file_info['filename']\n            with open(filename, encoding='utf-8') as file:\n                file_diff_dict[original_name] = Diff.from_string_arrays(\n                    original_file_dict[original_name], file.readlines(),\n                    rename=False if original_name == filename else filename)\n\n        return file_diff_dict\n\n    if 'EDITOR' in environ:\n        apply.__defaults__ = (environ['EDITOR'],)\n", "path": "coalib/results/result_actions/OpenEditorAction.py"}]}