Mercurial > vim
comparison src/eval.c @ 10000:233289599874 v7.4.2273
commit https://github.com/vim/vim/commit/3056735ae8a366aa7fcb51872520895251858637
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 27 21:25:44 2016 +0200
patch 7.4.2273
Problem: getwininfo() and getbufinfo() are inefficient.
Solution: Do not make a copy of all window/buffer-local options. Make it
possible to get them with gettabwinvar() or getbufvar().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 27 Aug 2016 21:30:06 +0200 |
parents | b329e3ca0dcb |
children | 4aead6a9b7a9 |
comparison
equal
deleted
inserted
replaced
9999:2c5b2fc3a9f9 | 10000:233289599874 |
---|---|
8468 need_switch_win = !(tp == curtab && win == curwin); | 8468 need_switch_win = !(tp == curtab && win == curwin); |
8469 if (!need_switch_win | 8469 if (!need_switch_win |
8470 || switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK) | 8470 || switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK) |
8471 #endif | 8471 #endif |
8472 { | 8472 { |
8473 if (*varname == '&') /* window-local-option */ | 8473 if (*varname == '&') |
8474 { | 8474 { |
8475 if (get_option_tv(&varname, rettv, 1) == OK) | 8475 if (varname[1] == NUL) |
8476 { | |
8477 /* get all window-local options in a dict */ | |
8478 dict_T *opts = get_winbuf_options(FALSE); | |
8479 | |
8480 if (opts != NULL) | |
8481 { | |
8482 rettv->v_type = VAR_DICT; | |
8483 rettv->vval.v_dict = opts; | |
8484 ++opts->dv_refcount; | |
8485 done = TRUE; | |
8486 } | |
8487 } | |
8488 else if (get_option_tv(&varname, rettv, 1) == OK) | |
8489 /* window-local-option */ | |
8476 done = TRUE; | 8490 done = TRUE; |
8477 } | 8491 } |
8478 else | 8492 else |
8479 { | 8493 { |
8480 /* Look up the variable. */ | 8494 /* Look up the variable. */ |