Commit 9984b97
Restore cwd on rustfmt failure before opening lwindow (#316)
If rustfmt fails RunRustFmt helpfully opens the lwindow to show
the errors rustfmt encountered.
The 'lwindow' command opens the location list window, and makes that
the active vim window.
Before rustfmt is executed RunRustFmt change CWD to the directory
where the file to be formated resides. CWD is restored before exiting
RunRustFmt.
The problem was that location list window was opened before restoring
CWD, which meant that we only restored the directory of the lwindow.
The window holding the formatted rust file is left with CWD of that
file.
The obvious solution is to restore the CWD *before* opening the
location list window.1 parent 2234f0d commit 9984b97
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
| |||
0 commit comments