xuhdev / SingleCompile

A Vim plugin making it more convenient to compile or run a single source file.
https://singlecompile.topbug.net
GNU General Public License v3.0
123 stars 20 forks source link

Preserve alternate file when showing results #68

Closed mMontu closed 8 years ago

mMontu commented 8 years ago

It can be distracting the change in the alternate file caused by the creation of the result window. Despite it usually doesn't cause problems after the window is created, it can be unexpected after a compilation error, subsequent correction and result window is recreated:

  1. vim has a single window containing fileA
  2. :SCCompileRun successful --> fileA on the left window, __SINGLE_COMPILE_RUN_RESULT__ on the right window
  3. open fileB on the left window
  4. Ctrl+^ on the left window goes back to fileA
  5. :SCCompileRun successful
  6. Ctrl+^ on the left window goes back to fileB, repeating goes back to fileA
  7. changes fileA, :SCCompileRun fails -> fileA on top window, compilation on quickfix ( __SINGLE_COMPILE_RUN_RESULT__ closed)
  8. correct fileA, :SCCompileRun successful --> fileA on the left window, __SINGLE_COMPILE_RUN_RESULT__ on the right window
  9. Ctrl+^ on the left window changes it to __SINGLE_COMPILE_RUN_RESULT__ instead of going to fileB
xuhdev commented 8 years ago

Makes sense to me. Thanks!