aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/highlight.c12
-rw-r--r--src/nvim/highlight_defs.h1
-rw-r--r--src/nvim/lua/vim.lua2
-rw-r--r--src/nvim/os/env.c3
-rw-r--r--src/nvim/syntax.c4
5 files changed, 14 insertions, 8 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index 093cc4923b..83ee89b2a1 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -308,8 +308,16 @@ int hl_combine_attr(int char_attr, int prim_attr)
// start with low-priority attribute, and override colors if present below.
HlAttrs new_en = char_aep;
- new_en.cterm_ae_attr |= spell_aep.cterm_ae_attr;
- new_en.rgb_ae_attr |= spell_aep.rgb_ae_attr;
+ if (spell_aep.cterm_ae_attr & HL_NOCOMBINE) {
+ new_en.cterm_ae_attr = spell_aep.cterm_ae_attr;
+ } else {
+ new_en.cterm_ae_attr |= spell_aep.cterm_ae_attr;
+ }
+ if (spell_aep.rgb_ae_attr & HL_NOCOMBINE) {
+ new_en.rgb_ae_attr = spell_aep.rgb_ae_attr;
+ } else {
+ new_en.rgb_ae_attr |= spell_aep.rgb_ae_attr;
+ }
if (spell_aep.cterm_fg_color > 0) {
new_en.cterm_fg_color = spell_aep.cterm_fg_color;
diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h
index f9c2c03fc6..255699c8e0 100644
--- a/src/nvim/highlight_defs.h
+++ b/src/nvim/highlight_defs.h
@@ -18,6 +18,7 @@ typedef enum {
HL_UNDERCURL = 0x10,
HL_STANDOUT = 0x20,
HL_STRIKETHROUGH = 0x40,
+ HL_NOCOMBINE = 0x80,
} HlAttrFlags;
/// Stores a complete highlighting entry, including colors and attributes
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua
index a03e97490d..b1a684b977 100644
--- a/src/nvim/lua/vim.lua
+++ b/src/nvim/lua/vim.lua
@@ -189,7 +189,7 @@ paste = (function()
if mode == 'c' and not got_line1 then -- cmdline-mode: paste only 1 line.
got_line1 = (#lines > 1)
vim.api.nvim_set_option('paste', true) -- For nvim_input().
- local line1, _ = string.gsub(lines[1], '[\r\n\012\027]', ' ') -- Scrub.
+ local line1 = lines[1]:gsub('<', '<lt>'):gsub('[\r\n\012\027]', ' ') -- Scrub.
vim.api.nvim_input(line1)
vim.api.nvim_set_option('paste', false)
elseif mode ~= 'c' then -- Else: discard remaining cmdline-mode chunks.
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 54fdd7961c..13853016d1 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -102,9 +102,6 @@ bool os_env_exists(const char *name)
assert(r != UV_EINVAL);
if (r != 0 && r != UV_ENOENT && r != UV_ENOBUFS) {
ELOG("uv_os_getenv(%s) failed: %d %s", name, r, uv_err_name(r));
-#ifdef WIN32
- return (r == UV_UNKNOWN);
-#endif
}
return (r == 0 || r == UV_ENOBUFS);
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 675d484d67..ac8ace9fff 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -116,10 +116,10 @@ static int include_link = 0; /* when 2 include "nvim/link" and "clear" */
/// following names, separated by commas (but no spaces!).
static char *(hl_name_table[]) =
{ "bold", "standout", "underline", "undercurl",
- "italic", "reverse", "inverse", "strikethrough", "NONE" };
+ "italic", "reverse", "inverse", "strikethrough", "nocombine", "NONE" };
static int hl_attr_table[] =
{ HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_UNDERCURL, HL_ITALIC, HL_INVERSE,
- HL_INVERSE, HL_STRIKETHROUGH, 0 };
+ HL_INVERSE, HL_STRIKETHROUGH, HL_NOCOMBINE, 0 };
// The patterns that are being searched for are stored in a syn_pattern.
// A match item consists of one pattern.