Vim selection underlined rather than reversed

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim selection underlined rather than reversed

Jeenu V
Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?

This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed

Thanks,
Jeenu

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

Capture.PNG (2K) Download Attachment
working.PNG (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Tony Mechelynck
On Mon, Apr 15, 2019 at 5:24 PM Jeenu <[hidden email]> wrote:
>
> Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?
>
> This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed
>
> Thanks,
> Jeenu

I don't know why it happens but I know how to find out: next time the
problem happens, and after making sure Vim is in Normal mode (this
will usually mean hitting <Esc>, which will clear the Visual
highlighting) type

              :verbose hi Visual

followed by <Enter>. Vim will answer by telling you not only exactly
what the Visual highlight is now set to, but also, which line of which
script (if any) last changed it. The script name and line can only be
missing if that highlight is either at its default, or was last set
manually.

Another possibly relevant setting is the 'background' setting, which
may be "dark" or "light" (without the quotes) and defines whether Vim
thinks that your current default background is a dark one or a bright
one respectively.

                :verbose set bg

will tell you the current value and which script (if any) last set it.
Here it is more likely that no script will be mentioned, meaning the
value is still the default value (which, in Console Vim, can be either
"light" or "dark" depending on what Vim believes that you were using
immediately before startup; in gvim, whose Normal highlight is usually
black on white unless you are using a colorscheme, the default is
usually "light").

Best regards,
Tony.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Grant Taylor-2
In reply to this post by Jeenu V
On 4/15/19 9:24 AM, Jeenu wrote:
> Sometimes, after I attach to a tmux session, visual selection in
> an already-running vim instance is shown as underlined instead of
> reversed. See the attached files for the difference; both are from the
> same host - one from new, and the other from existing session. The only
> way out I've found is to quit and launch vim again. Does any one know
> why this happens and/or how to fix it?

This sounds to me like screen is loosing state and not (re)displaying
things properly after some condition.

I would bet another order of magnitude that this is the case if you
visually select something so it's highlighted, change screen (disconnect
/ switch screens), change screen back (reconnect / switch back), and
what was highlighted is now underlined.

> This is the same problem as someone had posted a while ago:
> https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed

This seems to have the same symptoms to me.

You can probably test vim, if not eliminate it from the scenario, by
playing with ANSI control codes at a command line and see if the
symptoms are the same as vim when changing screen (see above).



--
Grant. . . .
unix || die

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Jeenu V
In reply to this post by Tony Mechelynck
On Monday, April 15, 2019 at 7:18:03 PM UTC+1, Tony Mechelynck wrote:

> On Mon, Apr 15, 2019 at 5:24 PM Jeenu wrote:
> >
> > Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?
> >
> > This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed
> >
> > Thanks,
> > Jeenu
>
> I don't know why it happens but I know how to find out: next time the
> problem happens, and after making sure Vim is in Normal mode (this
> will usually mean hitting <Esc>, which will clear the Visual
> highlighting) type
>
>               :verbose hi Visual
I've attached screen shots capture of running the command two sessions. The output of the hi command shows reversed mode in both sessions.

Also, both sessions say background is dark.

Not sure what to make of these.

Jeenu

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

visual_working.png (8K) Download Attachment
visual.png (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Christian Brabandt

On Mo, 15 Apr 2019, Jeenu wrote:

> On Monday, April 15, 2019 at 7:18:03 PM UTC+1, Tony Mechelynck wrote:
> > On Mon, Apr 15, 2019 at 5:24 PM Jeenu wrote:
> > >
> > > Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?
> > >
> > > This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed
> > >
> > > Thanks,
> > > Jeenu
> >
> > I don't know why it happens but I know how to find out: next time the
> > problem happens, and after making sure Vim is in Normal mode (this
> > will usually mean hitting <Esc>, which will clear the Visual
> > highlighting) type
> >
> >               :verbose hi Visual
>
> I've attached screen shots capture of running the command two sessions. The output of the hi command shows reversed mode in both sessions.
>
> Also, both sessions say background is dark.
>
> Not sure what to make of these.

Please show the text output.

Another thing that is likely to be the cause is, Vim is using the
VisualNOS highlighting group. This is used, when Vim cannot connect to
the X Server.  You mentioned using tmux and re-attaching sessions, so my
guess is, the re-attachment made Vim not correctly reset the X connect.

So the different highlighting is a way to let you know of it.

There was an issue about Vim not correctly resetting up the X
connection, (I believe #3649) and a fix seems to have been included by
8.1.0615.

Best,
Christian
--
Mir willst du zum Gotte machen
Solch ein Jammerbild am Holze!
                -- Johann Wolfgang von Goethe

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Tony Mechelynck
In reply to this post by Jeenu V
On Mon, Apr 15, 2019 at 9:00 PM Jeenu <[hidden email]> wrote:

>
> On Monday, April 15, 2019 at 7:18:03 PM UTC+1, Tony Mechelynck wrote:
> > On Mon, Apr 15, 2019 at 5:24 PM Jeenu wrote:
> > >
> > > Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?
> > >
> > > This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed
> > >
> > > Thanks,
> > > Jeenu
> >
> > I don't know why it happens but I know how to find out: next time the
> > problem happens, and after making sure Vim is in Normal mode (this
> > will usually mean hitting <Esc>, which will clear the Visual
> > highlighting) type
> >
> >               :verbose hi Visual
>
> I've attached screen shots capture of running the command two sessions. The output of the hi command shows reversed mode in both sessions.
>
> Also, both sessions say background is dark.
>
> Not sure what to make of these.
>
> Jeenu
>

The right-hand screenshot (with underlining) shows that the highlight
was set by the "desert" colorscheme.

                :colors default

will clear that.

Best regards,
Tony.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Jeenu V
In reply to this post by Christian Brabandt
On Monday, April 15, 2019 at 8:15:19 PM UTC+1, Christian Brabandt wrote:

> On Mo, 15 Apr 2019, Jeenu wrote:
>
> > On Monday, April 15, 2019 at 7:18:03 PM UTC+1, Tony Mechelynck wrote:
> > > On Mon, Apr 15, 2019 at 5:24 PM Jeenu wrote:
> > > >
> > > > Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?
> > > >
> > > > This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed
> > > >
> > > > Thanks,
> > > > Jeenu
> > >
> > > I don't know why it happens but I know how to find out: next time the
> > > problem happens, and after making sure Vim is in Normal mode (this
> > > will usually mean hitting <Esc>, which will clear the Visual
> > > highlighting) type
> > >
> > >               :verbose hi Visual
> >
> > I've attached screen shots capture of running the command two sessions. The output of the hi command shows reversed mode in both sessions.
> >
> > Also, both sessions say background is dark.
> >
> > Not sure what to make of these.
>
> Please show the text output.
:verbose hi Visual
Visual         xxx term=reverse cterm=reverse ctermbg=242 guifg=khaki guibg=olivedrab
        Last set from /usr/share/vim/vim74/colors/desert.vim
Press ENTER or type command to continue

> Another thing that is likely to be the cause is, Vim is using the
> VisualNOS highlighting group. This is used, when Vim cannot connect to
> the X Server.  You mentioned using tmux and re-attaching sessions, so my
> guess is, the re-attachment made Vim not correctly reset the X connect.
>
> So the different highlighting is a way to let you know of it.
>
> There was an issue about Vim not correctly resetting up the X
> connection, (I believe #3649) and a fix seems to have been included by
> 8.1.0615.
The Cygwin server I'm running on my Windows host (vim runs on a remote Linux host) did restart, so could be that issue.

Jeenu

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vim selection underlined rather than reversed

Jeenu V
In reply to this post by Tony Mechelynck
On Monday, April 15, 2019 at 8:25:39 PM UTC+1, Tony Mechelynck wrote:

> On Mon, Apr 15, 2019 at 9:00 PM Jeenu wrote:
> >
> > On Monday, April 15, 2019 at 7:18:03 PM UTC+1, Tony Mechelynck wrote:
> > > On Mon, Apr 15, 2019 at 5:24 PM Jeenu wrote:
> > > >
> > > > Sometimes, after I attach to a tmux session, visual selection in an already-running vim instance is shown as underlined instead of reversed. See the attached files for the difference; both are from the same host - one from new, and the other from existing session. The only way out I've found is to quit and launch vim again. Does any one know why this happens and/or how to fix it?
> > > >
> > > > This is the same problem as someone had posted a while ago: https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed
> > > >
> > > > Thanks,
> > > > Jeenu
> > >
> > > I don't know why it happens but I know how to find out: next time the
> > > problem happens, and after making sure Vim is in Normal mode (this
> > > will usually mean hitting <Esc>, which will clear the Visual
> > > highlighting) type
> > >
> > >               :verbose hi Visual
> >
> > I've attached screen shots capture of running the command two sessions. The output of the hi command shows reversed mode in both sessions.
> >
> > Also, both sessions say background is dark.
> >
> > Not sure what to make of these.
> >
> > Jeenu
> >
>
> The right-hand screenshot (with underlining) shows that the highlight
> was set by the "desert" colorscheme.
>
>                 :colors default
>
> will clear that.
Switching color scheme didn't have any effect, if that's what you were suggesting.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.