Mercurial > vim
comparison src/ui.c @ 18679:fd95d4dbeb37 v8.1.2331
patch 8.1.2331: the option.c file is still very big
Commit: https://github.com/vim/vim/commit/7bae0b1bc84a95d565ffab38cf7f82ad21c656b6
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 21 22:14:18 2019 +0100
patch 8.1.2331: the option.c file is still very big
Problem: The option.c file is still very big.
Solution: Move a few functions to where they fit better. (Yegappan
Lakshmanan, closes #4895)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 21 Nov 2019 22:15:03 +0100 |
parents | df141c730008 |
children | 49b78d6465e5 |
comparison
equal
deleted
inserted
replaced
18678:cb4a4b71df4a | 18679:fd95d4dbeb37 |
---|---|
1942 return TRUE; | 1942 return TRUE; |
1943 #endif | 1943 #endif |
1944 } | 1944 } |
1945 #endif | 1945 #endif |
1946 | 1946 |
1947 #endif /* FEAT_CLIPBOARD */ | 1947 /* |
1948 * Extract the items in the 'clipboard' option and set global values. | |
1949 * Return an error message or NULL for success. | |
1950 */ | |
1951 char * | |
1952 check_clipboard_option(void) | |
1953 { | |
1954 int new_unnamed = 0; | |
1955 int new_autoselect_star = FALSE; | |
1956 int new_autoselect_plus = FALSE; | |
1957 int new_autoselectml = FALSE; | |
1958 int new_html = FALSE; | |
1959 regprog_T *new_exclude_prog = NULL; | |
1960 char *errmsg = NULL; | |
1961 char_u *p; | |
1962 | |
1963 for (p = p_cb; *p != NUL; ) | |
1964 { | |
1965 if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL)) | |
1966 { | |
1967 new_unnamed |= CLIP_UNNAMED; | |
1968 p += 7; | |
1969 } | |
1970 else if (STRNCMP(p, "unnamedplus", 11) == 0 | |
1971 && (p[11] == ',' || p[11] == NUL)) | |
1972 { | |
1973 new_unnamed |= CLIP_UNNAMED_PLUS; | |
1974 p += 11; | |
1975 } | |
1976 else if (STRNCMP(p, "autoselect", 10) == 0 | |
1977 && (p[10] == ',' || p[10] == NUL)) | |
1978 { | |
1979 new_autoselect_star = TRUE; | |
1980 p += 10; | |
1981 } | |
1982 else if (STRNCMP(p, "autoselectplus", 14) == 0 | |
1983 && (p[14] == ',' || p[14] == NUL)) | |
1984 { | |
1985 new_autoselect_plus = TRUE; | |
1986 p += 14; | |
1987 } | |
1988 else if (STRNCMP(p, "autoselectml", 12) == 0 | |
1989 && (p[12] == ',' || p[12] == NUL)) | |
1990 { | |
1991 new_autoselectml = TRUE; | |
1992 p += 12; | |
1993 } | |
1994 else if (STRNCMP(p, "html", 4) == 0 && (p[4] == ',' || p[4] == NUL)) | |
1995 { | |
1996 new_html = TRUE; | |
1997 p += 4; | |
1998 } | |
1999 else if (STRNCMP(p, "exclude:", 8) == 0 && new_exclude_prog == NULL) | |
2000 { | |
2001 p += 8; | |
2002 new_exclude_prog = vim_regcomp(p, RE_MAGIC); | |
2003 if (new_exclude_prog == NULL) | |
2004 errmsg = e_invarg; | |
2005 break; | |
2006 } | |
2007 else | |
2008 { | |
2009 errmsg = e_invarg; | |
2010 break; | |
2011 } | |
2012 if (*p == ',') | |
2013 ++p; | |
2014 } | |
2015 if (errmsg == NULL) | |
2016 { | |
2017 clip_unnamed = new_unnamed; | |
2018 clip_autoselect_star = new_autoselect_star; | |
2019 clip_autoselect_plus = new_autoselect_plus; | |
2020 clip_autoselectml = new_autoselectml; | |
2021 clip_html = new_html; | |
2022 vim_regfree(clip_exclude_prog); | |
2023 clip_exclude_prog = new_exclude_prog; | |
2024 #ifdef FEAT_GUI_GTK | |
2025 if (gui.in_use) | |
2026 { | |
2027 gui_gtk_set_selection_targets(); | |
2028 gui_gtk_set_dnd_targets(); | |
2029 } | |
2030 #endif | |
2031 } | |
2032 else | |
2033 vim_regfree(new_exclude_prog); | |
2034 | |
2035 return errmsg; | |
2036 } | |
2037 | |
2038 #endif // FEAT_CLIPBOARD | |
1948 | 2039 |
1949 /***************************************************************************** | 2040 /***************************************************************************** |
1950 * Functions that handle the input buffer. | 2041 * Functions that handle the input buffer. |
1951 * This is used for any GUI version, and the unix terminal version. | 2042 * This is used for any GUI version, and the unix terminal version. |
1952 * | 2043 * |