E325 ATTENTION message wrapping/formatting problem

55 views
Skip to first unread message

Trey Blancher

unread,
Sep 29, 2023, 4:41:18 PM9/29/23
to vim_use
I'm using vim 9.0.1850 on macOS Ventura 13.6, installed via Homebrew.  I have a problem with the E325 ATTENTION message, informing me of an existing swap file.  It appears that every line in the message is inordinately long, such that most of the message scrolls off the top of my terminal emulator window (and I can't scroll up to see it since I'm using vim in a tmux session/window/pane in Alacritty).  This looks like a formatting or a text wrappings problem.

Here's a link to what I've copied out to the visible window, to try and demonstrate what I'm running into:  https://paste.rs/TUl2R (it doesn't appear I can attach files to this Google Groups message). Here's a screenshot from my vertical rotated monitor: Screenshot 2023-09-29 at 15.22.48.png

This has been going on for quite some time, I don't know exactly when it started.  Is there any way to fix this?

Trey Blancher

Lifepillar

unread,
Sep 30, 2023, 5:05:24 PM9/30/23
to vim...@googlegroups.com
On 2023-09-29, 'Trey Blancher' via vim_use <vim...@googlegroups.com> wrote:
> I have a problem with the E325 ATTENTION message, informing me of an
> existing swap file. It appears that every line in the message is
> inordinately long,
> [...]
> This has been going on for quite some time, I don't know exactly when it
> started. Is there any way to fix this?

I don't know, but you may mitigate the problem with `SwapExists` to call
a function that uses a less intrusive prompt.

For example, vimrc includes:

vim9script
import autoload "my/libvimrc.vim" as lib
set cmdheight=2
autocmd SwapExists * lib.SwapExists()

Then, in libvimrc.vim, I define:

export def SwapExists()
echohl WarningMsg
echon $'A swap file exists: {fnamemodify(v:swapname, ":t")}'
echohl None
echon "\n" .. 'read-(o)nly (e)dit (r)ecover (d)elete (q)uit (a)bort (ENTER for details) '
v:swapchoice = nr2char(getchar())
echo "\r"
enddef

The same can be done in legacy Vim script, of course.

Hope this helps,
Life.

Christian Brabandt

unread,
Sep 30, 2023, 5:09:20 PM9/30/23
to vim...@googlegroups.com

On Fr, 29 Sep 2023, 'Trey Blancher' via vim_use wrote:

> I'm using vim 9.0.1850 on macOS Ventura 13.6, installed via Homebrew. I
> have a problem with the E325 ATTENTION message, informing me of an existing
> swap file. It appears that every line in the message is inordinately long,
> such that most of the message scrolls off the top of my terminal emulator
> window (and I can't scroll up to see it since I'm using vim in a tmux
> session/window/pane in Alacritty). This looks like a formatting or a text
> wrapping*s* problem.
>
> Here's a link to what I've copied out to the visible window, to try and
> demonstrate what I'm running into: https://paste.rs/TUl2R (it doesn't
> appear I can attach files to this Google Groups message). Here's a
> screenshot from my vertical rotated monitor: [image: Screenshot 2023-09-29
> at 15.22.48.png]
>
> This has been going on for quite some time, I don't know exactly when it
> started. Is there any way to fix this?

This is surprising and I have never seen this issue. Does it only happen
in Alacritty? Always? Can you check in different terminal emulators and
also in the GUI? What once it shows up, you abort vim, and restart using
`vim --clean` and then open the exact same file (so the E325 should
trigger again)?

Thanks,
Christian
--
Look at it this way: Your daughter just named the fresh turkey you brought
home "Cuddles", so you're going out to buy a canned ham. And you're still
drinking ordinary scotch?

Trey Blancher

unread,
Oct 2, 2023, 2:22:01 PM10/2/23
to vim...@googlegroups.com
Christian,

Thanks for the reply!  Unfortunately I don't have gvim installed (I could never get the hang of using it).  I tried in iTerm, which had a similar issue as Alacritty (lines slightly shorter, but still lots of visual space between the lines of the E325 ATTENTION message).  But Terminal.app didn't have the same problem.  So I thought,"Aha! It's different termcaps causing the issue!"  In Terminal.app TERM is defaulting to xterm-256color, whereas in iTerm it was set to screen-256color, and in Alacritty I use tmux heavily so it was set to tmux-256color.  

Unless you can think of a better way to solve this, I can just set up an alias for vim='TERM=xterm-256color vim' and that will be a sufficient workaround for my purposes.  When I executed `TERM=xterm-256color vim` manually it fixed the problem.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/qj4f8eYkQ5U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZRiOdoDKSjKXWmP5%40256bit.org.

Trey Blancher

unread,
Oct 2, 2023, 2:25:40 PM10/2/23
to vim...@googlegroups.com
Life,

Thanks for the reply!  Unfortunately your proposed workaround looks like a severe hack.  Christian had responded asking me to check other terminal emulators, and it appears to have been an issue with termcap (i.e. the TERM environment variable).  Manually running `TERM=xterm-256color vim` seems to fix it for me.

If you have any related suggestions I would love to see them, but I had to do something similar for mutt (sadly which I can't use anymore at work due to MFA requirements which preclude IMAP) for it to show colors.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/qj4f8eYkQ5U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages