From 2901921a1b5bf72cb404fed0ed0510124eaf6e8b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:30:18 +0300 Subject: digraph: Ignore false positive Reversed order is intentional, digraphs allow swapping characters. --- src/nvim/digraph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/digraph.c') diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 560205fe7d..fb4a8c6d0d 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1569,7 +1569,8 @@ int getdigraph(int char1, int char2, int meta_char) if (((retval = getexactdigraph(char1, char2, meta_char)) == char2) && (char1 != char2) - && ((retval = getexactdigraph(char2, char1, meta_char)) == char1)) { + && ((retval = getexactdigraph(char2, char1, meta_char)) // -V764 + == char1)) { return char2; } return retval; -- cgit From 4f0fc1f06a6b551c081f1e4abf1a119588c6a386 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:32:38 +0300 Subject: digraph: Fix errors due to has_mbyte and friends being fixed --- src/nvim/digraph.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/nvim/digraph.c') diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index fb4a8c6d0d..66fb525920 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1676,11 +1676,7 @@ static void printdigraph(digr_T *dp) int list_width; - if ((dy_flags & DY_UHEX) || has_mbyte) { - list_width = 13; - } else { - list_width = 11; - } + list_width = 13; if (dp->result != 0) { if (msg_col > Columns - list_width) { @@ -1701,15 +1697,11 @@ static void printdigraph(digr_T *dp) *p++ = dp->char2; *p++ = ' '; - if (has_mbyte) { - // add a space to draw a composing char on - if (enc_utf8 && utf_iscomposing(dp->result)) { - *p++ = ' '; - } - p += (*mb_char2bytes)(dp->result, p); - } else { - *p++ = (char_u)dp->result; + // add a space to draw a composing char on + if (utf_iscomposing(dp->result)) { + *p++ = ' '; } + p += (*mb_char2bytes)(dp->result, p); if (char2cells(dp->result) == 1) { *p++ = ' '; -- cgit From c2f3e361c52ec4e7149ea1d8c6a1202e0873da8e Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:11:50 +0300 Subject: *: Add comment to all C files --- src/nvim/digraph.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/digraph.c') diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 66fb525920..32e71f61f7 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file digraph.c /// /// code for digraphs -- cgit