Mercurial > vim
comparison src/popupwin.c @ 28315:62cc3b60493b v8.2.4683
patch 8.2.4683: verbose check with dict_find() to see if a key is present
Commit: https://github.com/vim/vim/commit/4829c1c9e9095a3303caec9af7d02f6547f6df0e
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Apr 4 15:16:54 2022 +0100
patch 8.2.4683: verbose check with dict_find() to see if a key is present
Problem: Verbose check with dict_find() to see if a key is present.
Solution: Add dict_has_key(). (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/10074)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 04 Apr 2022 16:30:04 +0200 |
parents | a4aad5142959 |
children | 427600f3b1c5 |
comparison
equal
deleted
inserted
replaced
28314:7bc5b23adf8f | 28315:62cc3b60493b |
---|---|
1955 d = argvars[1].vval.v_dict; | 1955 d = argvars[1].vval.v_dict; |
1956 } | 1956 } |
1957 | 1957 |
1958 if (d != NULL) | 1958 if (d != NULL) |
1959 { | 1959 { |
1960 if (dict_find(d, (char_u *)"tabpage", -1) != NULL) | 1960 if (dict_has_key(d, "tabpage")) |
1961 tabnr = (int)dict_get_number(d, (char_u *)"tabpage"); | 1961 tabnr = (int)dict_get_number(d, (char_u *)"tabpage"); |
1962 else if (type == TYPE_NOTIFICATION) | 1962 else if (type == TYPE_NOTIFICATION) |
1963 tabnr = -1; // notifications are global by default | 1963 tabnr = -1; // notifications are global by default |
1964 else | 1964 else |
1965 tabnr = 0; | 1965 tabnr = 0; |