Author Topic: How can I turned off multiple document tabs of the same file?  (Read 4206 times)

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
How can I turned off multiple document tabs of the same file?
« on: August 10, 2015, 03:15:44 AM »
As the title and the attachment.

It sometimes becomes hard to use when I'm doing a lot of searching / referencing.

Thanks a lot

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: How can I turned off multiple document tabs of the same file?
« Reply #1 on: August 10, 2015, 01:07:05 PM »
Just close each one you don't want.  Although I'm not sure why you have that many open in the first place.  Are they opening while you are searching, or do you have that many open before you do the search?

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: How can I turned off multiple document tabs of the same file?
« Reply #2 on: August 11, 2015, 05:03:56 AM »
Phil:

This tabs just increases when I jumped between preview window or check references or jumped from pure text search. And every time if I move the cursor to a different line, after text search / find reference / find definition, it auto increases one more instance of the same file.

I like this new tab more than the old one, but this instance increment kills me

Tim Kemp

  • Senior Community Member
  • Posts: 546
  • Hero Points: 92
Re: How can I turned off multiple document tabs of the same file?
« Reply #3 on: August 11, 2015, 12:46:11 PM »
It looks like the tab proliferation happens when you set Tools->Options->Editing->Editor Windows->Files per window to Multiple files share window. If you set it to One file per window it will jump to the correct tab, or open a new one instead of changing the current tab to yet another instance of the same file.

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: How can I turned off multiple document tabs of the same file?
« Reply #4 on: August 14, 2015, 08:35:21 AM »
Tim:

Thanks, but I'm using "One file per windows" as my default.

Tim Kemp

  • Senior Community Member
  • Posts: 546
  • Hero Points: 92
Re: How can I turned off multiple document tabs of the same file?
« Reply #5 on: August 14, 2015, 10:16:33 AM »
That's interesting. I also use One file per window, and the only time I see the multiple tabs per document is when I explicitly tell it to duplicate a window. If you figure out what is causing all your windows let us know. Maybe we can come up with a solution.

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: How can I turned off multiple document tabs of the same file?
« Reply #6 on: August 16, 2015, 01:25:58 PM »
Thanks Tim, it is very weird, I know.
I've found out how to reproduce this issue, but can't figure out why.

1. Bind "close-buffer" to a hotkey "ALT+Q", and set the keyboard layout as "visual studio".
2. Open workspace file "fake_code.vpw".
2. Open a.c, use "SHIFT+F12" to find references to function "BEntry", reference windows will pop out, then double click on the reference on b.c.
3. Press ALT+Q to close the tab of b.c, and the tab of a.c will duplicated as two.

Dennis

  • Senior Community Member
  • Posts: 3954
  • Hero Points: 515
Re: How can I turned off multiple document tabs of the same file?
« Reply #7 on: August 17, 2015, 04:11:09 PM »
I think what you really want is the "quit" command rather than "close-buffer".

Tim Kemp

  • Senior Community Member
  • Posts: 546
  • Hero Points: 92
Re: How can I turned off multiple document tabs of the same file?
« Reply #8 on: August 17, 2015, 05:02:14 PM »
Dennis,

That makes sense. If the window isn't getting closed, but the buffer is, something needs to show and if there is already a window for every buffer, there is going to be a duplicate.

Thanks!

Tim

Gilvin

  • Community Member
  • Posts: 86
  • Hero Points: 1
Re: How can I turned off multiple document tabs of the same file?
« Reply #9 on: August 20, 2015, 03:51:05 PM »
Dennis:

Thanks, I got it all wrong >:(

I found that "close window" can also do the job.

Thanks, you guys are awesome.

Gilvin.