aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/digraph.c
diff options
context:
space:
mode:
authorJakob Schnitzer <mail@jakobschnitzer.de>2017-04-24 11:35:10 +0200
committerJakob Schnitzer <mail@jakobschnitzer.de>2017-04-24 11:35:10 +0200
commitff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1 (patch)
tree526b1df09b06121bdbc6ef5254ef53821958a6cb /src/nvim/digraph.c
parent4049492b6d7b8805686b14dbacb3b729abd03308 (diff)
parent7f6d3d305269fd1139bc2aec9a91bf98ad595199 (diff)
downloadrneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.gz
rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.tar.bz2
rneovim-ff8b2eb435c518f0eafd0e509afe1f5ee4a81fd1.zip
Merge branch 'master' into option-fixes
Diffstat (limited to 'src/nvim/digraph.c')
-rw-r--r--src/nvim/digraph.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index 560205fe7d..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
@@ -1569,7 +1572,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 +1679,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 +1700,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++ = ' ';