diff options
author | dundargoc <gocdundar@gmail.com> | 2022-10-22 12:36:38 +0200 |
---|---|---|
committer | dundargoc <gocdundar@gmail.com> | 2022-11-06 11:44:10 +0100 |
commit | 731cdde28ea8d48cc23ba2752a08c261c87eee92 (patch) | |
tree | 92e814050fdbca64aca435f03975b6d5678fbdf3 /src/nvim/api/tabpage.c | |
parent | a79d28e4d7939c13f38cf4ce63ff240011bca96d (diff) | |
download | rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.tar.gz rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.tar.bz2 rneovim-731cdde28ea8d48cc23ba2752a08c261c87eee92.zip |
refactor: fix clang-tidy warnings
Enable and fix bugprone-misplaced-widening-cast warning.
Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
Diffstat (limited to 'src/nvim/api/tabpage.c')
-rw-r--r-- | src/nvim/api/tabpage.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c index b81fc3b7d7..31f9fab82a 100644 --- a/src/nvim/api/tabpage.c +++ b/src/nvim/api/tabpage.c @@ -110,15 +110,14 @@ Window nvim_tabpage_get_win(Tabpage tabpage, Error *err) if (tab == curtab) { return nvim_get_current_win(); - } else { - FOR_ALL_WINDOWS_IN_TAB(wp, tab) { - if (wp == tab->tp_curwin) { - return wp->handle; - } + } + FOR_ALL_WINDOWS_IN_TAB(wp, tab) { + if (wp == tab->tp_curwin) { + return wp->handle; } - // There should always be a current window for a tabpage - abort(); } + // There should always be a current window for a tabpage + abort(); } /// Gets the tabpage number |