commit
e3b08a0fc4
|
@ -2242,8 +2242,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||
|
||||
*'fileformat'* *'ff'*
|
||||
'fileformat' 'ff' string (Windows default: "dos",
|
||||
Unix default: "unix",
|
||||
Macintosh default: "mac")
|
||||
Unix default: "unix")
|
||||
local to buffer
|
||||
This gives the <EOL> of the current buffer, which is used for
|
||||
reading/writing the buffer from/to a file:
|
||||
|
@ -2265,7 +2264,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||
'fileformats' 'ffs' string (default:
|
||||
Vim+Vi Win32: "dos,unix",
|
||||
Vim Unix: "unix,dos",
|
||||
Vim Mac: "mac,unix,dos",
|
||||
Vi others: "")
|
||||
global
|
||||
This gives the end-of-line (<EOL>) formats that will be tried when
|
||||
|
|
|
@ -3773,7 +3773,10 @@ int do_join(size_t count,
|
|||
|
||||
if (insert_space && t > 0) {
|
||||
curr = skipwhite(curr);
|
||||
if (*curr != ')' && currsize != 0 && endcurr1 != TAB
|
||||
if (*curr != NUL
|
||||
&& *curr != ')'
|
||||
&& currsize != 0
|
||||
&& endcurr1 != TAB
|
||||
&& (!has_format_option(FO_MBYTE_JOIN)
|
||||
|| (utf_ptr2char(curr) < 0x100 && endcurr1 < 0x100))
|
||||
&& (!has_format_option(FO_MBYTE_JOIN2)
|
||||
|
|
|
@ -4559,9 +4559,9 @@ static qfline_T *qf_find_closest_entry(qf_list_T *qfl,
|
|||
|
||||
/// Get the nth quickfix entry below the specified entry treating multiple
|
||||
/// entries on a single line as one. Searches forward in the list.
|
||||
static qfline_T *qf_get_nth_below_entry(qfline_T *entry,
|
||||
int *errornr,
|
||||
linenr_T n)
|
||||
static void qf_get_nth_below_entry(qfline_T *entry,
|
||||
int *errornr,
|
||||
linenr_T n)
|
||||
{
|
||||
while (n-- > 0 && !got_int) {
|
||||
qfline_T *first_entry = entry;
|
||||
|
@ -4582,15 +4582,13 @@ static qfline_T *qf_get_nth_below_entry(qfline_T *entry,
|
|||
entry = entry->qf_next;
|
||||
(*errornr)++;
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
/// Get the nth quickfix entry above the specified entry treating multiple
|
||||
/// entries on a single line as one. Searches backwards in the list.
|
||||
static qfline_T *qf_get_nth_above_entry(qfline_T *entry,
|
||||
int *errornr,
|
||||
linenr_T n)
|
||||
static void qf_get_nth_above_entry(qfline_T *entry,
|
||||
int *errornr,
|
||||
linenr_T n)
|
||||
{
|
||||
while (n-- > 0 && !got_int) {
|
||||
if (entry->qf_prev == NULL
|
||||
|
@ -4604,8 +4602,6 @@ static qfline_T *qf_get_nth_above_entry(qfline_T *entry,
|
|||
// If multiple entries are on the same line, then use the first entry
|
||||
entry = qf_find_first_entry_on_line(entry, errornr);
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
/// Find the n'th quickfix entry adjacent to line 'lnum' in buffer 'bnr' in the
|
||||
|
@ -4629,9 +4625,9 @@ static int qf_find_nth_adj_entry(qf_list_T *qfl,
|
|||
if (--n > 0) {
|
||||
// Go to the n'th entry in the current buffer
|
||||
if (dir == FORWARD) {
|
||||
adj_entry = qf_get_nth_below_entry(adj_entry, &errornr, n);
|
||||
qf_get_nth_below_entry(adj_entry, &errornr, n);
|
||||
} else {
|
||||
adj_entry = qf_get_nth_above_entry(adj_entry, &errornr, n);
|
||||
qf_get_nth_above_entry(adj_entry, &errornr, n);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1910,11 +1910,11 @@ int init_syl_tab(slang_T *slang)
|
|||
// Count the number of syllables in "word".
|
||||
// When "word" contains spaces the syllables after the last space are counted.
|
||||
// Returns zero if syllables are not defines.
|
||||
static int count_syllables(slang_T *slang, char_u *word)
|
||||
static int count_syllables(slang_T *slang, const char_u *word)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
int cnt = 0;
|
||||
bool skip = false;
|
||||
char_u *p;
|
||||
int len;
|
||||
syl_item_T *syl;
|
||||
int c;
|
||||
|
@ -1922,7 +1922,7 @@ static int count_syllables(slang_T *slang, char_u *word)
|
|||
if (slang->sl_syllable == NULL)
|
||||
return 0;
|
||||
|
||||
for (p = word; *p != NUL; p += len) {
|
||||
for (const char_u *p = word; *p != NUL; p += len) {
|
||||
// When running into a space reset counter.
|
||||
if (*p == ' ') {
|
||||
len = 1;
|
||||
|
@ -2625,9 +2625,10 @@ static bool spell_mb_isword_class(int cl, const win_T *wp)
|
|||
|
||||
// Returns true if "p" points to a word character.
|
||||
// Wide version of spell_iswordp().
|
||||
static bool spell_iswordp_w(int *p, win_T *wp)
|
||||
static bool spell_iswordp_w(const int *p, const win_T *wp)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
int *s;
|
||||
const int *s;
|
||||
|
||||
if (*p < 256 ? wp->w_s->b_spell_ismw[*p]
|
||||
: (wp->w_s->b_spell_ismw_mb != NULL
|
||||
|
|
|
@ -9,6 +9,27 @@ func Test_join_with_count()
|
|||
call setline(1, ['one', 'two', 'three', 'four'])
|
||||
normal 10J
|
||||
call assert_equal('one two three four', getline(1))
|
||||
|
||||
call setline(1, ['one', '', 'two'])
|
||||
normal J
|
||||
call assert_equal('one', getline(1))
|
||||
|
||||
call setline(1, ['one', ' ', 'two'])
|
||||
normal J
|
||||
call assert_equal('one', getline(1))
|
||||
|
||||
call setline(1, ['one', '', '', 'two'])
|
||||
normal JJ
|
||||
call assert_equal('one', getline(1))
|
||||
|
||||
call setline(1, ['one', ' ', ' ', 'two'])
|
||||
normal JJ
|
||||
call assert_equal('one', getline(1))
|
||||
|
||||
call setline(1, ['one', '', '', 'two'])
|
||||
normal 2J
|
||||
call assert_equal('one', getline(1))
|
||||
|
||||
quit!
|
||||
endfunc
|
||||
|
||||
|
|
Loading…
Reference in New Issue