diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-05 18:06:43 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-25 18:57:35 -0300 |
commit | 071aca9c8a751579e396227a4e08faa8ada924b8 (patch) | |
tree | 5ad08f880c459f26815db5b46c9e8b70f2129e91 /src/nvim/api/buffer.c | |
parent | 05d60c4812f1981f2d03991e33ed54aa2cca3ed6 (diff) | |
download | rneovim-071aca9c8a751579e396227a4e08faa8ada924b8.tar.gz rneovim-071aca9c8a751579e396227a4e08faa8ada924b8.tar.bz2 rneovim-071aca9c8a751579e396227a4e08faa8ada924b8.zip |
api: Move switch_to_win_for_buf/restore_win_for_buf to api helpers
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r-- | src/nvim/api/buffer.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index dfc3e501c2..5bd48fc19f 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -516,33 +516,6 @@ ArrayOf(Integer, 2) buffer_get_mark(Buffer buffer, String name, Error *err) return rv; } -// Find a window that contains "buf" and switch to it. -// If there is no such window, use the current window and change "curbuf". -// Caller must initialize save_curbuf to NULL. -// restore_win_for_buf() MUST be called later! -static void switch_to_win_for_buf(buf_T *buf, - win_T **save_curwinp, - tabpage_T **save_curtabp, - buf_T **save_curbufp) -{ - win_T *wp; - tabpage_T *tp; - - if (!find_win_for_buf(buf, &wp, &tp) - || switch_win(save_curwinp, save_curtabp, wp, tp, true) == FAIL) - switch_buffer(save_curbufp, buf); -} - -static void restore_win_for_buf(win_T *save_curwin, - tabpage_T *save_curtab, - buf_T *save_curbuf) -{ - if (save_curbuf == NULL) { - restore_win(save_curwin, save_curtab, true); - } else { - restore_buffer(save_curbuf); - } -} // Check if deleting lines made the cursor position invalid. // Changed the lines from "lo" to "hi" and added "extra" lines (negative if |