1
0
forked from aniani/vim

patch 9.1.1284: not possible to configure pum truncation char

Problem:  not possible to configure the completion menu truncation
          character
Solution: add the "trunc" suboption to the 'fillchars' setting to
          configure the truncation indicator (glepnir).

closes: #17006

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-04-07 20:57:14 +02:00
committed by Christian Brabandt
parent 2ffb4d0298
commit b87620466c
36 changed files with 337 additions and 271 deletions

View File

@@ -1,8 +1,8 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43
|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43
@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|.@2| +0#4040ff13#ffffff0@52
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|.@2| +0#4040ff13#ffffff0@52
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@52
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@52
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +1,8 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43
|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43
@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|.@2| +0#4040ff13#ffffff0@42
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|.@2| +0#4040ff13#ffffff0@42
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@42
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@42
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +1,8 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a| @43
|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b| @43
@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a> @31
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|.@2| +0#4040ff13#ffffff0@54
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|.@2| +0#4040ff13#ffffff0@54
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@54
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@54
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +1,10 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44
|1+0#0000001#e0e0e08|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_| | +0#4040ff13#ffffff0@43
|一*0#0000001#ffd7ff255|二|三|四|五|六|七|八|九|十| +&@10| +0#4040ff13#ffffff0@43
|a+0#0000001#ffd7ff255|b|c|d|e|f|g|h|i|j| @20| +0#4040ff13#ffffff0@43
|上*0#0000001#ffd7ff255|下|左|右| +&@22| +0#4040ff13#ffffff0@43
|~| @73
|~| @73
|~| @73
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a|
|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b|
@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_
|1|2|3|4|5|6|7|8|9|_|a> @20
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@11
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|6|7|>| +0#4040ff13#ffffff0@11
|~| @30
|~| @30
|~| @30
|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@16

View File

@@ -1,8 +1,8 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44
|1+0#0000001#e0e0e08|2|3|4|5|6|7|.@2| +0#4040ff13#ffffff0@64
|一*0#0000001#ffd7ff255|二|三| +&|.@2| +0#4040ff13#ffffff0@64
|a+0#0000001#ffd7ff255|b|c|d|e|f|g|h|i|j| +0#4040ff13#ffffff0@64
|上*0#0000001#ffd7ff255|下|左|右| +&@1| +0#4040ff13#ffffff0@64
|1+0#0000001#e0e0e08|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_| | +0#4040ff13#ffffff0@43
|一*0#0000001#ffd7ff255|二|三|四|五|六|七|八|九|十| +&@10| +0#4040ff13#ffffff0@43
|a+0#0000001#ffd7ff255|b|c|d|e|f|g|h|i|j| @20| +0#4040ff13#ffffff0@43
|上*0#0000001#ffd7ff255|下|左|右| +&@22| +0#4040ff13#ffffff0@43
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +1,8 @@
| +0&#ffffff0@43> |_|9|8|7|6|5|4|3|2|1|_|9|8|7|6|5|4|3|2|1|_|9|8|7|6|5|4|3|2|1
| +0#4040ff13&@64|.+0#0000001#e0e0e08@2|7|6|5|4|3|2|1
| +0#4040ff13#ffffff0@64|.+0#0000001#ffd7ff255@2| |三*&|二|一
| +0#4040ff13#ffffff0@64|j+0#0000001#ffd7ff255|i|h|g|f|e|d|c|b|a
| +0#4040ff13#ffffff0@64| +0#0000001#ffd7ff255@1|右*&|左|下|上
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44
|1+0#0000001#e0e0e08|2|3|4|5|6|7|8|9|>| +0#4040ff13#ffffff0@64
|一*0#0000001#ffd7ff255|二|三|四| +&|>| +0#4040ff13#ffffff0@64
|a+0#0000001#ffd7ff255|b|c|d|e|f|g|h|i|>| +0#4040ff13#ffffff0@64
|上*0#0000001#ffd7ff255|下|左|右| +&@1| +0#4040ff13#ffffff0@64
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +1,8 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44
|1+0#0000001#e0e0e08|2| +0#4040ff13#ffffff0@72
|一*0#0000001#ffd7ff255| +0#4040ff13#ffffff0@72
|a+0#0000001#ffd7ff255|b| +0#4040ff13#ffffff0@72
|上*0#0000001#ffd7ff255| +0#4040ff13#ffffff0@72
|~| @73
|~| @73
|~| @73
| +0&#ffffff0@43> |_|9|8|7|6|5|4|3|2|1|_|9|8|7|6|5|4|3|2|1|_|9|8|7|6|5|4|3|2|1
| +0#4040ff13&@64|<+0#0000001#e0e0e08|9|8|7|6|5|4|3|2|1
| +0#4040ff13#ffffff0@64|<+0#0000001#ffd7ff255| |四*&|三|二|一
| +0#4040ff13#ffffff0@64|<+0#0000001#ffd7ff255|i|h|g|f|e|d|c|b|a
| +0#4040ff13#ffffff0@64| +0#0000001#ffd7ff255@1|右*&|左|下|上
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~

View File

@@ -1,10 +1,8 @@
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|a|
|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|b|
@12|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_
|1|2|3|4|5|6|7|8|9|_|a> @20
|~+0#4040ff13&| @9| +0#0000001#e0e0e08|1|2|3|4|5|.@2| +0#4040ff13#ffffff0@11
|~| @9| +0#0000001#ffd7ff255|1|2|3|4|5|.@2| +0#4040ff13#ffffff0@11
|~| @30
|~| @30
|~| @30
|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |2| +0#0000000&@16
|1+0&#ffffff0|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_|1|2|3|4|5|6|7|8|9|_> @44
|1+0#0000001#e0e0e08|>| +0#4040ff13#ffffff0@72
| +0#0000001#ffd7ff255|>| +0#4040ff13#ffffff0@72
|a+0#0000001#ffd7ff255|>| +0#4040ff13#ffffff0@72
| +0#0000001#ffd7ff255|>| +0#4040ff13#ffffff0@72
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|>| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|>| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|>| +0#4040ff13#ffffff0@60
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|…| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|…| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|…| +0#4040ff13#ffffff0@60
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| @7|f|o|…| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|r| @7|一*&|…+&| +0#4040ff13#ffffff0@60
|一*0#0000001#ffd7ff255|二|三|四|五| +&|m|u|…| +0#4040ff13#ffffff0@60
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| @7|f|o|>| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|r| @7|一*&|>+&| +0#4040ff13#ffffff0@60
|一*0#0000001#ffd7ff255|二|三|四|五| +&|m|u|>| +0#4040ff13#ffffff0@60
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|_| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|_| +0#4040ff13#ffffff0@60
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|_| +0#4040ff13#ffffff0@60
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
| +0&#ffffff0@70> |o@1|f
| +0#4040ff13&@60|<+0#0000001#e0e0e08|f| |d|n|i|K|o@1|f| |o@1|f
| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|b| |d|n|i|K|r|a|b| |r|a|b
| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|b| |d|n|i|K|z|a|b| |z|a|b
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
| @73|~

View File

@@ -0,0 +1,8 @@
| +0&#ffffff0@70> |o@1|f
| +0#4040ff13&@60|<+0#0000001#e0e0e08|o|f| @7|o@1|f
| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|一*&| +&@7|r|a|b
| +0#4040ff13#ffffff0@60|<+0#0000001#ffd7ff255|u|m| |五*&|四|三|二|一
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
| @73|~

View File

@@ -0,0 +1,8 @@
| +0&#ffffff0@70> |o@1|f
| +0#4040ff13&@60|…+0#0000001#e0e0e08|o|f| @7|o@1|f
| +0#4040ff13#ffffff0@60|…+0#0000001#ffd7ff255|一*&| +&@7|r|a|b
| +0#4040ff13#ffffff0@60|…+0#0000001#ffd7ff255|u|m| |五*&|四|三|二|一
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
| @73|~

View File

@@ -0,0 +1,8 @@
| +0&#ffffff0@70> |r|a|b
| +0#4040ff13&@60|<+0#0000001#e0e0e08|o|f| |三*&|二|一| +&|r|a|b
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
| @73|~
| @73|~
| @73|~

View File

@@ -0,0 +1,8 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1|>| +0#4040ff13#ffffff0@70
|b+0#0000001#ffd7ff255|a|r|>| +0#4040ff13#ffffff0@70
|一*0#0000001#ffd7ff255| +&|>| +0#4040ff13#ffffff0@70
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -0,0 +1,8 @@
| +0&#ffffff0@70> |o@1|f
| +0#4040ff13&@70|<+0#0000001#e0e0e08|o@1|f
| +0#4040ff13#ffffff0@70|<+0#0000001#ffd7ff255|r|a|b
| +0#4040ff13#ffffff0@70|<+0#0000001#ffd7ff255| |一*&
| +0#4040ff13#ffffff0@73|~
| @73|~
| @73|~
| @73|~

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|o@1|M|e|n|u| | +0#4040ff13#ffffff0@54
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|a|r|M|e|n|u| | +0#4040ff13#ffffff0@54
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|a|z|M|e|n|u| | +0#4040ff13#ffffff0@54
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|o@1|M|e|n|u| +0#4040ff13#ffffff0@55
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|a|r|M|e|n|u| +0#4040ff13#ffffff0@55
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|a|z|M|e|n|u| +0#4040ff13#ffffff0@55
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|o@1|.@2| +0#4040ff13#ffffff0@56
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|a|r|.@2| +0#4040ff13#ffffff0@56
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|a|z|.@2| +0#4040ff13#ffffff0@56
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|.@2| +0#4040ff13#ffffff0@58
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|.@2| +0#4040ff13#ffffff0@58
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|.@2| +0#4040ff13#ffffff0@58
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| |f|o@1| +0#4040ff13#ffffff0@59
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| |b|a|r| +0#4040ff13#ffffff0@59
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| |b|a|z| +0#4040ff13#ffffff0@59
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|K|i|n|d| | +0#4040ff13#ffffff0@62
|b+0#0000001#ffd7ff255|a|r| |b|a|r|K|i|n|d| | +0#4040ff13#ffffff0@62
|b+0#0000001#ffd7ff255|a|z| |b|a|z|K|i|n|d| | +0#4040ff13#ffffff0@62
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08|o@1| |f|o@1|.@2| +0#4040ff13#ffffff0@64
|b+0#0000001#ffd7ff255|a|r| |b|a|r|.@2| +0#4040ff13#ffffff0@64
|b+0#0000001#ffd7ff255|a|z| |b|a|z|.@2| +0#4040ff13#ffffff0@64
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -1,8 +0,0 @@
|f+0&#ffffff0|o@1> @71
|f+0#0000001#e0e0e08| +0#4040ff13#ffffff0@73
|b+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@73
|b+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@73
|~| @73
|~| @73
|~| @73
|~| @73

View File

@@ -203,8 +203,9 @@ let test_values = {
\ 'fileformats': [['', 'dos', 'dos,unix'], ['xxx']],
\ 'fillchars': [['', 'stl:x', 'stlnc:x', 'vert:x', 'fold:x', 'foldopen:x',
\ 'foldclose:x', 'foldsep:x', 'diff:x', 'eob:x', 'lastline:x',
\ 'stl:\ ,vert:\|,fold:\\,diff:x'],
\ ['xxx', 'vert:']],
\ 'trunc:_', 'trunc:_,eob:x,trunc:_',
\ 'stl:\ ,vert:\|,fold:\\,trunc:…,diff:x'],
\ ['xxx', 'vert:', 'trunc:', "trunc:\b"]],
\ 'foldclose': [['', 'all'], ['xxx']],
\ 'foldmethod': [['manual', 'indent', 'expr', 'marker', 'syntax', 'diff'],
\ ['', 'xxx', 'expr,diff']],

View File

@@ -2018,8 +2018,9 @@ func Test_pum_maxwidth()
call term_sendkeys(buf, "\<Esc>3Gdd\"zp")
call term_sendkeys(buf, ":set lines=10 columns=32\<CR>")
call TermWait(buf, 50)
call term_sendkeys(buf, "GA\<C-N>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_09', {'rows': 10, 'cols': 32})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_05', {'rows': 10, 'cols': 32})
call term_sendkeys(buf, "\<Esc>3Gdd\"zp")
call StopVimInTerminal(buf)
@@ -2029,106 +2030,129 @@ func Test_pum_maxwidth_multibyte()
CheckScreendump
let lines =<< trim END
let g:change = 0
func Omni_test(findstart, base)
if a:findstart
return col(".")
endif
return [
\ #{word: "123456789_123456789_123456789_"},
\ #{word: "一二三四五六七八九十"},
\ #{word: "abcdefghij"},
\ #{word: "上下左右"},
\ ]
if g:change == 0
return [
\ #{word: "123456789_123456789_123456789_"},
\ #{word: "一二三四五六七八九十"},
\ #{word: "abcdefghij"},
\ #{word: "上下左右"},
\ ]
elseif g:change == 1
return [
\ #{word: "foo", menu: "fooMenu", kind: "fooKind"},
\ #{word: "bar", menu: "barMenu", kind: "barKind"},
\ #{word: "baz", menu: "bazMenu", kind: "bazKind"},
\ ]
elseif g:change == 2
return [
\ #{word: "foo", menu: "fooMenu", kind: "fooKind"},
\ #{word: "bar", menu: "fooMenu", kind: "一二三四"},
\ #{word: "一二三四五", kind: "multi"},
\ ]
else
return [#{word: "bar", menu: "fooMenu", kind: "一二三"}]
endif
endfunc
set omnifunc=Omni_test
set cot+=menuone
END
call writefile(lines, 'Xtest', 'D')
let buf = RunVimInTerminal('-S Xtest', {})
call TermWait(buf)
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_05', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_06', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=10\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_06', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_07', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
if has('rightleft')
call term_sendkeys(buf, ":set rightleft\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_07', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_08', {'rows': 8})
call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>")
endif
call term_sendkeys(buf, ":set pummaxwidth=2\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_08', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_09', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call StopVimInTerminal(buf)
endfunc
call term_sendkeys(buf, ":set pummaxwidth=14\<CR>")
call term_sendkeys(buf, ":let g:change=1\<CR>S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_10', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
func Test_pum_maxwidth_with_many_items()
CheckScreendump
let lines =<< trim END
func Omni_test(findstart, base)
if a:findstart
return col(".")
endif
return [
\ #{word: "foo", menu: "fooMenu", kind: "fooKind"},
\ #{word: "bar", menu: "barMenu", kind: "barKind"},
\ #{word: "baz", menu: "bazMenu", kind: "bazKind"},
\ ]
endfunc
set omnifunc=Omni_test
END
call writefile(lines, 'Xtest', 'D')
let buf = RunVimInTerminal('-S Xtest', {})
call TermWait(buf)
call term_sendkeys(buf, ":set pummaxwidth=20\<CR>")
" Unicode Character U+2026 but one cell
call term_sendkeys(buf, ":set fcs+=trunc:…\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_01', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_11', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=19\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_02', {'rows': 8})
call term_sendkeys(buf, ":let g:change=2\<CR>S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_12', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=18\<CR>") " display Ellipsis
call term_sendkeys(buf, ":set fcs&\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_03', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_13', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=16\<CR>") " display Ellipsis
call term_sendkeys(buf, ":set fcs=trunc:_\<CR>")
call term_sendkeys(buf, ":let g:change=1\<CR>")
call TermWait(buf, 50)
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_04', {'rows': 8})
call VerifyScreenDump(buf, 'Test_pum_maxwidth_14', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set fcs&\<CR>")
if has('rightleft')
call term_sendkeys(buf, ":set rightleft\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_15', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":let g:change=2\<CR>")
call TermWait(buf, 50)
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_16', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set fcs+=trunc:…\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_17', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set fcs&\<CR>")
call term_sendkeys(buf, ":let g:change=3\<CR>")
call TermWait(buf, 50)
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_18', {'rows': 8})
call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>")
endif
call term_sendkeys(buf, ":set pummaxwidth=4\<CR>")
call term_sendkeys(buf, ":let g:change=2\<CR>")
call TermWait(buf, 50)
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_19', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=15\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_05', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=12\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_06', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=10\<CR>") " display Ellipsis
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_07', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
call term_sendkeys(buf, ":set pummaxwidth=1\<CR>")
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_with_many_items_08', {'rows': 8})
call term_sendkeys(buf, "\<ESC>")
if has('rightleft')
call term_sendkeys(buf, ":set rightleft\<CR>")
call TermWait(buf, 50)
call term_sendkeys(buf, "S\<C-X>\<C-O>")
call VerifyScreenDump(buf, 'Test_pum_maxwidth_20', {'rows': 8})
call term_sendkeys(buf, "\<Esc>:set norightleft\<CR>")
endif
call StopVimInTerminal(buf)
endfunc