martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.2k stars 258 forks source link

vis:message functionality changed in commit 22d4709e8a30c8feb9b4da7d78e0ea6a57af83e8 #1034

Closed erf closed 1 year ago

erf commented 1 year ago

After commit 22d4709e8a30c8feb9b4da7d78e0ea6a57af83e8 I'm not able to concat messages to a single new window, instead a new window is created for each message. I found this when using https://github.com/erf/vis-plug plugin with the vis-list or vis-outdated command. Would it be possible to revert to the old behaviour?

deepcube commented 1 year ago

On Thu Aug 11, 2022 at 4:15 AM MDT, Erlend wrote:

After commit 22d4709e8a30c8feb9b4da7d78e0ea6a57af83e8 I'm not able to concat messages to a single new window, instead a new window is created for each message. I found this when using https://github.com/erf/vis-plug plugin with the vis-list or vis-outdated command. Would it be possible to revert to the old behaviour?

Sorry about that. I'll revert it for now and dig into it later to find a way to implement this without causing that issue.

Can you give me a minimal example that worked before but does not work now? Then I can use it to test against.

erf commented 1 year ago

Hi @deepcube i've made a small example visrc.lua file which looks like this:

require('vis')

vis.events.subscribe(vis.events.INIT, function()
        vis:message('hello 1')
        vis:message('hello 2')
end)

vis.events.subscribe(vis.events.WIN_OPEN, function(win)
        vis:message('hello 3')
        vis:message('hello 4')
end)

In the latest (d3cb76e) where the fix is reverted it prints the following on opening the editor:

Screenshot 2022-09-03 at 12 45 27

In commit f3828ef it just seem to hang now when i open the editor:

Screenshot 2022-09-03 at 12 54 34

If i comment out the vis:message in the WIN_OPEN event so it looks like this:

require('vis')

vis.events.subscribe(vis.events.INIT, function()
        vis:message('hello 1')
        vis:message('hello 2')
end)

vis.events.subscribe(vis.events.WIN_OPEN, function(win)
        --vis:message('hello 3')
        --vis:message('hello 4')
end)

I get the following:

Screenshot 2022-09-03 at 12 55 29

BTW:

It would be nice if i could choose where the new window would appear.