Mercurial > vim
comparison src/vim.h @ 18354:9f51d0cef8da v8.1.2171
patch 8.1.2171: mouse support not always available
Commit: https://github.com/vim/vim/commit/a1cb1d1dce14dd005797590721f1bcd0e7c3b35f
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 17 23:00:07 2019 +0200
patch 8.1.2171: mouse support not always available
Problem: Mouse support not always available.
Solution: Enable mouse support also in tiny version. Do not define
FEAT_MOUSE_XTERM on MS-Windows (didn't really work).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Oct 2019 23:15:04 +0200 |
parents | 506bf60a30a0 |
children | 368d6a478ae5 |
comparison
equal
deleted
inserted
replaced
18353:c3a0f5d3c9d4 | 18354:9f51d0cef8da |
---|---|
148 #include "feature.h" | 148 #include "feature.h" |
149 | 149 |
150 #if defined(MACOS_X_DARWIN) | 150 #if defined(MACOS_X_DARWIN) |
151 # if defined(FEAT_SMALL) && !defined(FEAT_CLIPBOARD) | 151 # if defined(FEAT_SMALL) && !defined(FEAT_CLIPBOARD) |
152 # define FEAT_CLIPBOARD | 152 # define FEAT_CLIPBOARD |
153 # endif | |
154 # if defined(FEAT_SMALL) && !defined(FEAT_MOUSE) | |
155 # define FEAT_MOUSE | |
156 # endif | 153 # endif |
157 #endif | 154 #endif |
158 | 155 |
159 // +x11 is only enabled when it's both available and wanted. | 156 // +x11 is only enabled when it's both available and wanted. |
160 #if defined(HAVE_X11) && defined(WANT_X11) | 157 #if defined(HAVE_X11) && defined(WANT_X11) |
1815 // Values for "do_profiling". | 1812 // Values for "do_profiling". |
1816 #define PROF_NONE 0 // profiling not started | 1813 #define PROF_NONE 0 // profiling not started |
1817 #define PROF_YES 1 // profiling busy | 1814 #define PROF_YES 1 // profiling busy |
1818 #define PROF_PAUSED 2 // profiling paused | 1815 #define PROF_PAUSED 2 // profiling paused |
1819 | 1816 |
1820 #ifdef FEAT_MOUSE | |
1821 | 1817 |
1822 // Codes for mouse button events in lower three bits: | 1818 // Codes for mouse button events in lower three bits: |
1823 # define MOUSE_LEFT 0x00 | 1819 #define MOUSE_LEFT 0x00 |
1824 # define MOUSE_MIDDLE 0x01 | 1820 #define MOUSE_MIDDLE 0x01 |
1825 # define MOUSE_RIGHT 0x02 | 1821 #define MOUSE_RIGHT 0x02 |
1826 # define MOUSE_RELEASE 0x03 | 1822 #define MOUSE_RELEASE 0x03 |
1827 | 1823 |
1828 // bit masks for modifiers: | 1824 // bit masks for modifiers: |
1829 # define MOUSE_SHIFT 0x04 | 1825 #define MOUSE_SHIFT 0x04 |
1830 # define MOUSE_ALT 0x08 | 1826 #define MOUSE_ALT 0x08 |
1831 # define MOUSE_CTRL 0x10 | 1827 #define MOUSE_CTRL 0x10 |
1832 | 1828 |
1833 // mouse buttons that are handled like a key press (GUI only) | 1829 // mouse buttons that are handled like a key press (GUI only) |
1834 // Note that the scroll wheel keys are inverted: MOUSE_5 scrolls lines up but | 1830 // Note that the scroll wheel keys are inverted: MOUSE_5 scrolls lines up but |
1835 // the result of this is that the window moves down, similarly MOUSE_6 scrolls | 1831 // the result of this is that the window moves down, similarly MOUSE_6 scrolls |
1836 // columns left but the window moves right. | 1832 // columns left but the window moves right. |
1837 # define MOUSE_4 0x100 // scroll wheel down | 1833 #define MOUSE_4 0x100 // scroll wheel down |
1838 # define MOUSE_5 0x200 // scroll wheel up | 1834 #define MOUSE_5 0x200 // scroll wheel up |
1839 | 1835 |
1840 # define MOUSE_X1 0x300 // Mouse-button X1 (6th) | 1836 #define MOUSE_X1 0x300 // Mouse-button X1 (6th) |
1841 # define MOUSE_X2 0x400 // Mouse-button X2 | 1837 #define MOUSE_X2 0x400 // Mouse-button X2 |
1842 | 1838 |
1843 # define MOUSE_6 0x500 // scroll wheel left | 1839 #define MOUSE_6 0x500 // scroll wheel left |
1844 # define MOUSE_7 0x600 // scroll wheel right | 1840 #define MOUSE_7 0x600 // scroll wheel right |
1845 | 1841 |
1846 // 0x20 is reserved by xterm | 1842 // 0x20 is reserved by xterm |
1847 # define MOUSE_DRAG_XTERM 0x40 | 1843 #define MOUSE_DRAG_XTERM 0x40 |
1848 | 1844 |
1849 # define MOUSE_DRAG (0x40 | MOUSE_RELEASE) | 1845 #define MOUSE_DRAG (0x40 | MOUSE_RELEASE) |
1850 | 1846 |
1851 // Lowest button code for using the mouse wheel (xterm only) | 1847 // Lowest button code for using the mouse wheel (xterm only) |
1852 # define MOUSEWHEEL_LOW 0x60 | 1848 #define MOUSEWHEEL_LOW 0x60 |
1853 | 1849 |
1854 # define MOUSE_CLICK_MASK 0x03 | 1850 #define MOUSE_CLICK_MASK 0x03 |
1855 | 1851 |
1856 # define NUM_MOUSE_CLICKS(code) \ | 1852 #define NUM_MOUSE_CLICKS(code) \ |
1857 (((unsigned)((code) & 0xC0) >> 6) + 1) | 1853 (((unsigned)((code) & 0xC0) >> 6) + 1) |
1858 | 1854 |
1859 # define SET_NUM_MOUSE_CLICKS(code, num) \ | 1855 #define SET_NUM_MOUSE_CLICKS(code, num) \ |
1860 (code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6) | 1856 (code) = ((code) & 0x3f) | ((((num) - 1) & 3) << 6) |
1861 | 1857 |
1862 // Added to mouse column for GUI when 'mousefocus' wants to give focus to a | 1858 // Added to mouse column for GUI when 'mousefocus' wants to give focus to a |
1863 // window by simulating a click on its status line. We could use up to 128 * | 1859 // window by simulating a click on its status line. We could use up to 128 * |
1864 // 128 = 16384 columns, now it's reduced to 10000. | 1860 // 128 = 16384 columns, now it's reduced to 10000. |
1865 # define MOUSE_COLOFF 10000 | 1861 #define MOUSE_COLOFF 10000 |
1866 | 1862 |
1867 /* | 1863 /* |
1868 * jump_to_mouse() returns one of first four these values, possibly with | 1864 * jump_to_mouse() returns one of first four these values, possibly with |
1869 * some of the other three added. | 1865 * some of the other three added. |
1870 */ | 1866 */ |
1871 # define IN_UNKNOWN 0 | 1867 #define IN_UNKNOWN 0 |
1872 # define IN_BUFFER 1 | 1868 #define IN_BUFFER 1 |
1873 # define IN_STATUS_LINE 2 // on status or command line | 1869 #define IN_STATUS_LINE 2 // on status or command line |
1874 # define IN_SEP_LINE 4 // on vertical separator line | 1870 #define IN_SEP_LINE 4 // on vertical separator line |
1875 # define IN_OTHER_WIN 8 // in other window but can't go there | 1871 #define IN_OTHER_WIN 8 // in other window but can't go there |
1876 # define CURSOR_MOVED 0x100 | 1872 #define CURSOR_MOVED 0x100 |
1877 # define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column | 1873 #define MOUSE_FOLD_CLOSE 0x200 // clicked on '-' in fold column |
1878 # define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column | 1874 #define MOUSE_FOLD_OPEN 0x400 // clicked on '+' in fold column |
1879 # define MOUSE_WINBAR 0x800 // in window toolbar | 1875 #define MOUSE_WINBAR 0x800 // in window toolbar |
1880 | 1876 |
1881 // flags for jump_to_mouse() | 1877 // flags for jump_to_mouse() |
1882 # define MOUSE_FOCUS 0x01 // need to stay in this window | 1878 #define MOUSE_FOCUS 0x01 // need to stay in this window |
1883 # define MOUSE_MAY_VIS 0x02 // may start Visual mode | 1879 #define MOUSE_MAY_VIS 0x02 // may start Visual mode |
1884 # define MOUSE_DID_MOVE 0x04 // only act when mouse has moved | 1880 #define MOUSE_DID_MOVE 0x04 // only act when mouse has moved |
1885 # define MOUSE_SETPOS 0x08 // only set current mouse position | 1881 #define MOUSE_SETPOS 0x08 // only set current mouse position |
1886 # define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode | 1882 #define MOUSE_MAY_STOP_VIS 0x10 // may stop Visual mode |
1887 # define MOUSE_RELEASED 0x20 // button was released | 1883 #define MOUSE_RELEASED 0x20 // button was released |
1888 | 1884 |
1889 # if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) | 1885 #if defined(UNIX) && defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) |
1890 # define CHECK_DOUBLE_CLICK 1 // Checking for double clicks ourselves. | 1886 # define CHECK_DOUBLE_CLICK 1 // Checking for double clicks ourselves. |
1891 # endif | 1887 #endif |
1892 | 1888 |
1893 #endif // FEAT_MOUSE | |
1894 | 1889 |
1895 // defines for eval_vars() | 1890 // defines for eval_vars() |
1896 #define VALID_PATH 1 | 1891 #define VALID_PATH 1 |
1897 #define VALID_HEAD 2 | 1892 #define VALID_HEAD 2 |
1898 | 1893 |