comparison src/terminal.c @ 18033:049a7481d737 v8.1.2012

patch 8.1.2012: more functions can be used as methods Commit: https://github.com/vim/vim/commit/7ee80f766130f22598c928415c92ec612a8f18cf Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 8 20:55:06 2019 +0200 patch 8.1.2012: more functions can be used as methods Problem: More functions can be used as methods. Solution: Make terminal functions usable as a method. Fix term_getattr().
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 Sep 2019 21:00:03 +0200
parents ba18f78c8529
children d1e77015f60b
comparison
equal deleted inserted replaced
18032:403b2abc9147 18033:049a7481d737
5053 attr = tv_get_number(&argvars[0]); 5053 attr = tv_get_number(&argvars[0]);
5054 name = tv_get_string_chk(&argvars[1]); 5054 name = tv_get_string_chk(&argvars[1]);
5055 if (name == NULL) 5055 if (name == NULL)
5056 return; 5056 return;
5057 5057
5058 if (attr > HL_ALL)
5059 attr = syn_attr2attr(attr);
5058 for (i = 0; i < sizeof(attrs)/sizeof(attrs[0]); ++i) 5060 for (i = 0; i < sizeof(attrs)/sizeof(attrs[0]); ++i)
5059 if (STRCMP(name, attrs[i].name) == 0) 5061 if (STRCMP(name, attrs[i].name) == 0)
5060 { 5062 {
5061 rettv->vval.v_number = (attr & attrs[i].attr) != 0 ? 1 : 0; 5063 rettv->vval.v_number = (attr & attrs[i].attr) != 0 ? 1 : 0;
5062 break; 5064 break;