mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	Merge pull request #17589 from kchibisov/add-dashed-dotted-underline
Add support for double, dashed, and dotted underlines
This commit is contained in:
		@@ -11408,14 +11408,22 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv, FunPtr fptr)
 | 
			
		||||
      p = highlight_has_attr(id, HL_STANDOUT, modec);
 | 
			
		||||
    }
 | 
			
		||||
    break;
 | 
			
		||||
  case 'u':
 | 
			
		||||
    if (STRLEN(what) <= 5 || TOLOWER_ASC(what[5]) != 'c') {  // underline
 | 
			
		||||
      p = highlight_has_attr(id, HL_UNDERLINE, modec);
 | 
			
		||||
    } else {  // undercurl
 | 
			
		||||
  case 'u': {
 | 
			
		||||
    const size_t len = STRLEN(what);
 | 
			
		||||
    if (len <= 5 || (TOLOWER_ASC(what[5]) == 'l' && len <= 9)) {  // underline
 | 
			
		||||
      p = highlight_has_attr(id, HL_UNDERCURL, modec);
 | 
			
		||||
    } else if (TOLOWER_ASC(what[5]) == 'c') {  // undercurl
 | 
			
		||||
       p = highlight_has_attr(id, HL_UNDERCURL, modec);
 | 
			
		||||
    } else if (len > 9 && TOLOWER_ASC(what[9]) == 'l') {  // underlineline
 | 
			
		||||
       p = highlight_has_attr(id, HL_UNDERLINELINE, modec);
 | 
			
		||||
    } else if (len > 6 && TOLOWER_ASC(what[6]) == 'o') {  // underdot
 | 
			
		||||
       p = highlight_has_attr(id, HL_UNDERDOT, modec);
 | 
			
		||||
    } else {  // underdash
 | 
			
		||||
       p = highlight_has_attr(id, HL_UNDERDASH, modec);
 | 
			
		||||
    }
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  rettv->v_type = VAR_STRING;
 | 
			
		||||
  rettv->vval.v_string = (char_u *)(p == NULL ? p : xstrdup(p));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user