mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:8.2.0864: pragmas are indented all the way to the left
Problem: Pragmas are indented all the way to the left. Solution: Add an option to indent progmas like normal code. (Max Rumpf, closes vim/vim#5468)d881b516da
N/A patches for version.c: vim-patch:8.1.2030: tests fail when build with normal features and terminal Problem: Tests fail when build with normal features and terminal. (Dominique Pelle) Solution: Disable tests that won't work. (closes vim/vim#4932)997d42427e
vim-patch:8.1.2063: some tests fail when +balloon_eval_term is missing Problem: Some tests fail when +balloon_eval_term is missing but _balloon_eval is present. (Dominique Pelle) Solution: Check the right feature in the test. (closes vim/vim#4962)1e82a784ac
vim-patch:8.2.1938: wiping out a terminal buffer makes some tests fail Problem: Wiping out a terminal buffer makes some tests fail. Solution: Do not wipe out the terminal buffer unless wanted.a46765a797
This commit is contained in:
@@ -1676,6 +1676,9 @@ void parse_cino(buf_T *buf)
|
||||
// Handle C++ extern "C" or "C++"
|
||||
buf->b_ind_cpp_extern_c = 0;
|
||||
|
||||
// Handle C #pragma directives
|
||||
buf->b_ind_pragma = 0;
|
||||
|
||||
for (p = buf->b_p_cino; *p; ) {
|
||||
l = p++;
|
||||
if (*p == '-') {
|
||||
@@ -1747,6 +1750,7 @@ void parse_cino(buf_T *buf)
|
||||
case 'N': buf->b_ind_cpp_namespace = n; break;
|
||||
case 'k': buf->b_ind_if_for_while = n; break;
|
||||
case 'E': buf->b_ind_cpp_extern_c = n; break;
|
||||
case 'P': buf->b_ind_pragma = n; break;
|
||||
}
|
||||
if (*p == ',')
|
||||
++p;
|
||||
@@ -1858,12 +1862,14 @@ int get_c_indent(void)
|
||||
goto laterend;
|
||||
}
|
||||
|
||||
/*
|
||||
* #defines and so on always go at the left when included in 'cinkeys'.
|
||||
*/
|
||||
// #defines and so on go at the left when included in 'cinkeys',
|
||||
// exluding pragmas when customized in 'cinoptions'
|
||||
if (*theline == '#' && (*linecopy == '#' || in_cinkeys('#', ' ', true))) {
|
||||
amount = curbuf->b_ind_hash_comment;
|
||||
goto theend;
|
||||
const char_u *const directive = skipwhite(theline + 1);
|
||||
if (curbuf->b_ind_pragma == 0 || STRNCMP(directive, "pragma", 6) != 0) {
|
||||
amount = curbuf->b_ind_hash_comment;
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user