aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/digraph.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-17 22:02:46 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-17 22:02:46 +0200
commitce7cba6d7f36e79d52825215ba7b6848397b0440 (patch)
treecf249b863e9bfa1a6943b91dc293cc38bf71f6a7 /src/nvim/digraph.c
parent7debba9d4295f09bc338a5f0718abdc54d565a56 (diff)
parent2eb9150a4fcb8f43599e5f470cbcb3a12195d910 (diff)
downloadrneovim-ce7cba6d7f36e79d52825215ba7b6848397b0440.tar.gz
rneovim-ce7cba6d7f36e79d52825215ba7b6848397b0440.tar.bz2
rneovim-ce7cba6d7f36e79d52825215ba7b6848397b0440.zip
Merge #6533 'Fix PVS-studio warnings'
Diffstat (limited to 'src/nvim/digraph.c')
-rw-r--r--src/nvim/digraph.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index 560205fe7d..66fb525920 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;
@@ -1675,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) {
@@ -1700,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++ = ' ';