quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
315 stars 26 forks source link

Weird interaction between visual mode and preview #367

Open memeplex opened 7 months ago

memeplex commented 7 months ago

I can toggle between visual/source modes with C-S-F4, the same tab switches between modes as expected.

But consider the following sequence.

  1. The editor is in source mode.
  2. I press the preview button and a preview pane is opened aside.
  3. I switch to visual mode with C-S-F4.
  4. Instead of replacing the current tab a new tab for the same file is created in visual mode. 🚨
  5. I switch to source mode with C-S-F4 from the new tab.
  6. The tab is closed and I'm sent back to the original one. 🚨
  7. I switch to visual mode again with C-S-F4.
  8. A new tab is open, etc.
  9. Now I go back to the original tab, keeping the new one open.
  10. From there I switch to visual mode again.
  11. Tab positions are swapped and I keep staying at the original one. 🚨

Now if I not only close the preview pane but also kill the preview process, everything comes back to normality.

I've attached a screencast showing the problem.


https://github.com/quarto-dev/quarto/assets/2845433/9956f365-f154-49c5-b43f-478f6e838591