Mercurial > vim
comparison src/option.c @ 9858:3e96d9ed2ca1 v7.4.2204
commit https://github.com/vim/vim/commit/b5ae48e9ffd3b8eb6ca4057de11f1bddcde8ce6f
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 12 22:23:25 2016 +0200
patch 7.4.2204
Problem: It is not easy to get information about buffers, windows and
tabpages.
Solution: Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan
Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 12 Aug 2016 22:30:07 +0200 |
parents | eed41404e383 |
children | 989d44d35a66 |
comparison
equal
deleted
inserted
replaced
9857:0ee54b6ef77d | 9858:3e96d9ed2ca1 |
---|---|
12327 || wp->w_buffer->b_has_sign_column | 12327 || wp->w_buffer->b_has_sign_column |
12328 # endif | 12328 # endif |
12329 ); | 12329 ); |
12330 } | 12330 } |
12331 #endif | 12331 #endif |
12332 | |
12333 #if defined(FEAT_EVAL) || defined(PROTO) | |
12334 /* | |
12335 * Get window or buffer local options. | |
12336 */ | |
12337 dict_T * | |
12338 get_winbuf_options(int bufopt) | |
12339 { | |
12340 dict_T *d; | |
12341 int opt_idx; | |
12342 | |
12343 d = dict_alloc(); | |
12344 if (d == NULL) | |
12345 return NULL; | |
12346 | |
12347 for (opt_idx = 0; !istermoption(&options[opt_idx]); opt_idx++) | |
12348 { | |
12349 struct vimoption *opt = &options[opt_idx]; | |
12350 | |
12351 if ((bufopt && (opt->indir & PV_BUF)) | |
12352 || (!bufopt && (opt->indir & PV_WIN))) | |
12353 { | |
12354 char_u *varp = get_varp(opt); | |
12355 | |
12356 if (varp != NULL) | |
12357 { | |
12358 if (opt->flags & P_STRING) | |
12359 dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp); | |
12360 else | |
12361 dict_add_nr_str(d, opt->fullname, *varp, NULL); | |
12362 } | |
12363 } | |
12364 } | |
12365 | |
12366 return d; | |
12367 } | |
12368 #endif |