Show More
@@ -37,7 +37,6 b' example, you could use a startup file like this::' | |||||
37 |
|
37 | |||
38 | import os |
|
38 | import os | |
39 | import subprocess |
|
39 | import subprocess | |
40 | import warnings |
|
|||
41 | import sys |
|
40 | import sys | |
42 |
|
41 | |||
43 | from .error import TryNext |
|
42 | from .error import TryNext | |
@@ -82,44 +81,6 b' def editor(self, filename, linenum=None, wait=True):' | |||||
82 | if wait and proc.wait() != 0: |
|
81 | if wait and proc.wait() != 0: | |
83 | raise TryNext() |
|
82 | raise TryNext() | |
84 |
|
83 | |||
85 | import tempfile |
|
|||
86 | from ..utils.decorators import undoc |
|
|||
87 |
|
||||
88 | @undoc |
|
|||
89 | def fix_error_editor(self,filename,linenum,column,msg): |
|
|||
90 | """DEPRECATED |
|
|||
91 |
|
||||
92 | Open the editor at the given filename, linenumber, column and |
|
|||
93 | show an error message. This is used for correcting syntax errors. |
|
|||
94 | The current implementation only has special support for the VIM editor, |
|
|||
95 | and falls back on the 'editor' hook if VIM is not used. |
|
|||
96 |
|
||||
97 | Call ip.set_hook('fix_error_editor',yourfunc) to use your own function, |
|
|||
98 | """ |
|
|||
99 |
|
||||
100 | warnings.warn(""" |
|
|||
101 | `fix_error_editor` is deprecated as of IPython 6.0 and will be removed |
|
|||
102 | in future versions. It appears to be used only for automatically fixing syntax |
|
|||
103 | error that has been broken for a few years and has thus been removed. If you |
|
|||
104 | happened to use this function and still need it please make your voice heard on |
|
|||
105 | the mailing list ipython-dev@python.org , or on the GitHub Issue tracker: |
|
|||
106 | https://github.com/ipython/ipython/issues/9649 """, UserWarning) |
|
|||
107 |
|
||||
108 | def vim_quickfix_file(): |
|
|||
109 | t = tempfile.NamedTemporaryFile() |
|
|||
110 | t.write('%s:%d:%d:%s\n' % (filename,linenum,column,msg)) |
|
|||
111 | t.flush() |
|
|||
112 | return t |
|
|||
113 | if os.path.basename(self.editor) != 'vim': |
|
|||
114 | self.hooks.editor(filename,linenum) |
|
|||
115 | return |
|
|||
116 | t = vim_quickfix_file() |
|
|||
117 | try: |
|
|||
118 | if os.system('vim --cmd "set errorformat=%f:%l:%c:%m" -q ' + t.name): |
|
|||
119 | raise TryNext() |
|
|||
120 | finally: |
|
|||
121 | t.close() |
|
|||
122 |
|
||||
123 |
|
84 | |||
124 | def synchronize_with_editor(self, filename, linenum, column): |
|
85 | def synchronize_with_editor(self, filename, linenum, column): | |
125 | pass |
|
86 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now