mouse.c: Adjust clicked column if chars are concealed (#5087)

syntax.c: Added syn_get_concealed_id()

tests: Added tests for mouse clicks on concealed text.
This commit is contained in:
Tommy Allen
2016-07-28 14:14:53 -04:00
committed by Justin M. Keyes
parent 56f178058a
commit 1f7304b846
3 changed files with 411 additions and 0 deletions

View File

@@ -5661,6 +5661,24 @@ int get_syntax_info(int *seqnrp)
return current_flags;
}
/// Get the sequence number of the concealed file position.
///
/// @return seqnr if the file position is concealed, 0 otherwise.
int syn_get_concealed_id(win_T *wp, linenr_T lnum, colnr_T col)
{
int seqnr;
int syntax_flags;
(void)syn_get_id(wp, lnum, col, false, NULL, false);
syntax_flags = get_syntax_info(&seqnr);
if (syntax_flags & HL_CONCEAL) {
return seqnr;
}
return 0;
}
/*
* Return conceal substitution character
*/