Mercurial > vim
comparison src/os_unix.c @ 11557:7e5e76d8d451 v8.0.0661
patch 8.0.0661: recognizing urxvt mouse codes does not work well
commit https://github.com/vim/vim/commit/a529ce068ba84d53343f3732b6a1ed4ad1fe3a68
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 22 22:37:57 2017 +0200
patch 8.0.0661: recognizing urxvt mouse codes does not work well
Problem: Recognizing urxvt mouse codes does not work well.
Solution: Recognize "Esc[*M" and "Esc[*m". (Maurice Bos, closes https://github.com/vim/vim/issues/1486)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 22 Jun 2017 22:45:04 +0200 |
parents | 2e6a0ea76a0d |
children | 2ec27561dd76 |
comparison
equal
deleted
inserted
replaced
11556:92e04864687e | 11557:7e5e76d8d451 |
---|---|
3769 (char_u *) IF_EB("\033[", ESC_STR "[")); | 3769 (char_u *) IF_EB("\033[", ESC_STR "[")); |
3770 else | 3770 else |
3771 del_mouse_termcode(KS_PTERM_MOUSE); | 3771 del_mouse_termcode(KS_PTERM_MOUSE); |
3772 # endif | 3772 # endif |
3773 # ifdef FEAT_MOUSE_URXVT | 3773 # ifdef FEAT_MOUSE_URXVT |
3774 /* same conflict as the dec mouse */ | |
3775 if (use_xterm_mouse() == 3 | 3774 if (use_xterm_mouse() == 3 |
3776 # ifdef FEAT_GUI | 3775 # ifdef FEAT_GUI |
3777 && !gui.in_use | 3776 && !gui.in_use |
3778 # endif | 3777 # endif |
3779 ) | 3778 ) |
3780 { | 3779 { |
3781 set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME) | 3780 set_mouse_termcode(KS_URXVT_MOUSE, (char_u *)(term_is_8bit(T_NAME) |
3782 ? IF_EB("\233", CSI_STR) | 3781 ? IF_EB("\233*M", CSI_STR "*M") |
3783 : IF_EB("\033[", ESC_STR "["))); | 3782 : IF_EB("\033[*M", ESC_STR "[*M"))); |
3784 | 3783 |
3785 if (*p_mouse != NUL) | 3784 if (*p_mouse != NUL) |
3786 { | 3785 { |
3787 mch_setmouse(FALSE); | 3786 mch_setmouse(FALSE); |
3788 setmouse(); | 3787 setmouse(); |
3790 } | 3789 } |
3791 else | 3790 else |
3792 del_mouse_termcode(KS_URXVT_MOUSE); | 3791 del_mouse_termcode(KS_URXVT_MOUSE); |
3793 # endif | 3792 # endif |
3794 # ifdef FEAT_MOUSE_SGR | 3793 # ifdef FEAT_MOUSE_SGR |
3795 /* There is no conflict with xterm mouse */ | |
3796 if (use_xterm_mouse() == 4 | 3794 if (use_xterm_mouse() == 4 |
3797 # ifdef FEAT_GUI | 3795 # ifdef FEAT_GUI |
3798 && !gui.in_use | 3796 && !gui.in_use |
3799 # endif | 3797 # endif |
3800 ) | 3798 ) |
3801 { | 3799 { |
3802 set_mouse_termcode(KS_SGR_MOUSE, (char_u *)(term_is_8bit(T_NAME) | 3800 set_mouse_termcode(KS_SGR_MOUSE, (char_u *)(term_is_8bit(T_NAME) |
3803 ? IF_EB("\233<", CSI_STR "<") | 3801 ? IF_EB("\233<*M", CSI_STR "<*M") |
3804 : IF_EB("\033[<", ESC_STR "[<"))); | 3802 : IF_EB("\033[<*M", ESC_STR "[<*M"))); |
3803 | |
3804 set_mouse_termcode(KS_SGR_MOUSE_RELEASE, (char_u *)(term_is_8bit(T_NAME) | |
3805 ? IF_EB("\233<*m", CSI_STR "<*m") | |
3806 : IF_EB("\033[<*m", ESC_STR "[<*m"))); | |
3805 | 3807 |
3806 if (*p_mouse != NUL) | 3808 if (*p_mouse != NUL) |
3807 { | 3809 { |
3808 mch_setmouse(FALSE); | 3810 mch_setmouse(FALSE); |
3809 setmouse(); | 3811 setmouse(); |
3810 } | 3812 } |
3811 } | 3813 } |
3812 else | 3814 else |
3815 { | |
3813 del_mouse_termcode(KS_SGR_MOUSE); | 3816 del_mouse_termcode(KS_SGR_MOUSE); |
3817 del_mouse_termcode(KS_SGR_MOUSE_RELEASE); | |
3818 } | |
3814 # endif | 3819 # endif |
3815 } | 3820 } |
3816 #endif | 3821 #endif |
3817 | 3822 |
3818 /* | 3823 /* |