aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-03-15 22:39:34 +0100
committerbfredl <bjorn.linse@gmail.com>2024-03-16 08:40:45 +0100
commitd1a30221fcb1307c59036ccddee0758395ceda4e (patch)
treee7b4edefbe71d44f426e7f9cba5494d815aa885b
parent102a72a21e2b5177516d2d3c44bd464e9b363bb9 (diff)
downloadrneovim-d1a30221fcb1307c59036ccddee0758395ceda4e.tar.gz
rneovim-d1a30221fcb1307c59036ccddee0758395ceda4e.tar.bz2
rneovim-d1a30221fcb1307c59036ccddee0758395ceda4e.zip
fix(intro): redrawing intro exposing pseudo-randomness
problem: redrawing intro exposes pseudo-randomness solution: remove pseudo-randomness
-rw-r--r--src/nvim/version.c15
-rw-r--r--test/functional/ui/messages_spec.lua12
2 files changed, 8 insertions, 19 deletions
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 27c3826cd2..d7f94fadae 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -2759,11 +2759,6 @@ void intro_message(bool colon)
blanklines = 0;
}
- // Show the sponsor and register message one out of four times, the Uganda
- // message two out of four times.
- int sponsor = (int)time(NULL);
- sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
-
// start displaying the message lines after half of the blank lines
int row = blanklines / 2;
@@ -2781,16 +2776,6 @@ void intro_message(bool colon)
mesg = xmallocz((size_t)mesg_size);
snprintf(mesg, (size_t)mesg_size + 1, p,
STR(NVIM_VERSION_MAJOR), STR(NVIM_VERSION_MINOR));
- } else if (sponsor != 0) {
- if (strstr(p, "children") != NULL) {
- p = sponsor < 0
- ? N_("Sponsor Vim development!")
- : N_("Become a registered Vim user!");
- } else if (strstr(p, "iccf") != NULL) {
- p = sponsor < 0
- ? N_("type :help sponsor<Enter> for information ")
- : N_("type :help register<Enter> for information ");
- }
}
if (mesg == NULL) {
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 92a925ad31..f5f268b8fe 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1623,7 +1623,8 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
- {MATCH:.*}|*2
+ {1:~ }Help poor children in Uganda!{1: }|
+ {1:~ }type :help iccf{5:<Enter>} for information {1: }|
{1:~ }|*5
]])
@@ -1645,7 +1646,8 @@ describe('ui/ext_messages', function()
{1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
- {MATCH:.*}|*2
+ {1:~ }Help poor children in Uganda!{1: }|
+ {1:~ }type :help iccf{5:<Enter>} for information {1: }|
{1:~ }|*5
]],
showmode = { { '-- INSERT --', 3 } },
@@ -1678,7 +1680,8 @@ describe('ui/ext_messages', function()
|
{MATCH: +}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+ +}|
|
- {MATCH:.*}|*2
+ Help poor children in Uganda! |
+ type :help iccf{5:<Enter>} for information |
|*5
]],
messages = {
@@ -1783,7 +1786,8 @@ it('ui/ext_multigrid supports intro screen', function()
{1:~ }|
{1:~{MATCH: +}}type :help news{5:<Enter>} to see changes in v{MATCH:%d+%.%d+}{1:{MATCH: +}}|
{1:~ }|
- {MATCH:.*}|*2
+ {1:~ }Help poor children in Uganda!{1: }|
+ {1:~ }type :help iccf{5:<Enter>} for information {1: }|
{1:~ }|*4
## grid 3
|