mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
eval: diff_hlID() and hlID() return same id
This commit is contained in:
@@ -8008,7 +8008,7 @@ static void f_diff_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
hlID = HLF_CHD; // Changed line.
|
||||
}
|
||||
}
|
||||
rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID;
|
||||
rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)(hlID + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -683,13 +683,17 @@ func Test_diff_hlID()
|
||||
|
||||
call assert_equal(synIDattr(diff_hlID(-1, 1), "name"), "")
|
||||
|
||||
call assert_equal(diff_hlID(1, 1), hlID("DiffChange"))
|
||||
call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
|
||||
call assert_equal(diff_hlID(1, 2), hlID("DiffText"))
|
||||
call assert_equal(synIDattr(diff_hlID(1, 2), "name"), "DiffText")
|
||||
call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "")
|
||||
call assert_equal(diff_hlID(3, 1), hlID("DiffAdd"))
|
||||
call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "DiffAdd")
|
||||
call assert_equal(synIDattr(diff_hlID(4, 1), "name"), "")
|
||||
|
||||
wincmd w
|
||||
call assert_equal(diff_hlID(1, 1), hlID("DiffChange"))
|
||||
call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange")
|
||||
call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "")
|
||||
call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "")
|
||||
|
Reference in New Issue
Block a user