On Thursday, October 4, 2012 8:35:40 PM UTC-5, Ben Fritz wrote: > On Thursday, October 4, 2012 7:06:22 PM UTC-5, Brandon Coleman wrote: > > > I had the idea of creating a command that would "link" two windows together > > so that whatever buffer is loaded in window 1 would be in the window 5 on > > tab 2. The problem with this idea is that there is not a unique ID for > > each window, So I came up with the proof of concept unique number patch > > below. > > > > > > But first a few question: > > > Is this something that is implemented and I just missed the code? > > > Is this the correct way to implement a unique window ID? > > > Would the VIM community be open to accepting a patch if I brought this code > > up to standards? > > > > > > > Can you tell us why you think you need unique window IDs? This seems like > something that could be done with a mixture of buffer-local, window-local, > and/or tab-local variables or options.
1. bufnr() is unique, but winnr() and tabpagenr() are not.. I feel that this is confusing and unexpected from the point of view of someone creating a vim script. 2. The real problem for me is that find_win_by_winnr(4,null) returns the fourth window in the current page. I can't find and work with a specific window. > > > > At the very least, you should certainly not REPLACE the existing window > number. The window number is set in a predictable way and can be used to > switch to specific windows with <C-W><C-W>. Making the window number unique > and static would make this impossible without first calling a function to > figure out what the window number is. This patch should create the function uwinnr(), leaving winnr() alone. -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
