This commit is contained in:
KillTheMule
2018-01-26 20:25:53 +01:00
parent 8bcc011959
commit 37b8e95fd6
7 changed files with 63 additions and 66 deletions

View File

@@ -85,9 +85,9 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err)
/// @return False when live updates couldn't be enabled because the buffer isn't
/// loaded; otherwise True.
Boolean nvim_buf_live_updates_start(uint64_t channel_id,
Buffer buffer,
Boolean send_buffer,
Error *err)
Buffer buffer,
Boolean send_buffer,
Error *err)
FUNC_API_SINCE(4) FUNC_API_REMOTE_ONLY
{
buf_T *buf = find_buffer_by_handle(buffer, err);
@@ -97,7 +97,6 @@ Boolean nvim_buf_live_updates_start(uint64_t channel_id,
}
return liveupdate_register(buf, channel_id, send_buffer);
}
//
/// Deactivate live updates from this buffer to the current channel.
@@ -107,8 +106,8 @@ Boolean nvim_buf_live_updates_start(uint64_t channel_id,
/// @return False when live updates couldn't be disabled because the buffer
/// isn't loaded; otherwise True.
Boolean nvim_buf_live_updates_stop(uint64_t channel_id,
Buffer buffer,
Error *err)
Buffer buffer,
Error *err)
FUNC_API_SINCE(4) FUNC_API_REMOTE_ONLY
{
buf_T *buf = find_buffer_by_handle(buffer, err);

View File

@@ -1738,9 +1738,9 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags)
if (flags & BLN_DUMMY)
buf->b_flags |= BF_DUMMY;
buf_clear_file(buf);
clrallmarks(buf); /* clear marks */
fmarks_check_names(buf); /* check file marks for this file */
buf->b_p_bl = (flags & BLN_LISTED) ? TRUE : FALSE; /* init 'buflisted' */
clrallmarks(buf); // clear marks
fmarks_check_names(buf); // check file marks for this file
buf->b_p_bl = (flags & BLN_LISTED) ? true : false; // init 'buflisted'
kv_destroy(buf->liveupdate_channels);
kv_init(buf->liveupdate_channels);
if (!(flags & BLN_DUMMY)) {

View File

@@ -745,8 +745,9 @@ void ex_retab(exarg_T *eap)
if (curbuf->b_p_ts != new_ts)
redraw_curbuf_later(NOT_VALID);
if (first_line != 0)
if (first_line != 0) {
changed_lines(first_line, 0, last_line + 1, 0L, true);
}
curwin->w_p_list = save_list; /* restore 'list' */

View File

@@ -837,7 +837,7 @@ open_line (
if (did_append) {
changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col,
curwin->w_cursor.lnum + 1, 1L, true);
did_append = FALSE;
did_append = false;
/* Move marks after the line break to the new line. */
if (flags & OPENLINE_MARKFIX)
@@ -1914,12 +1914,12 @@ void deleted_lines_mark(linenr_T lnum, long count)
* Takes care of calling changed() and updating b_mod_*.
* Careful: may trigger autocommands that reload the buffer.
*/
void
changed_lines (
linenr_T lnum, /* first line with change */
colnr_T col, /* column in first line with change */
linenr_T lnume, /* line below last changed line */
long xtra, /* number of extra lines (negative when deleting) */
void
changed_lines(
linenr_T lnum, // first line with change
colnr_T col, // column in first line with change
linenr_T lnume, // line below last changed line
long xtra, // number of extra lines (negative when deleting)
bool send_liveupdate // some callers like undo/redo call changed_lines()
// and then increment b_changedtick *again*. This flag
// allows these callers to send the LiveUpdate events

View File

@@ -632,12 +632,13 @@ void op_reindent(oparg_T *oap, Indenter how)
/* Mark changed lines so that they will be redrawn. When Visual
* highlighting was present, need to continue until the last line. When
* there is no change still need to remove the Visual highlighting. */
if (last_changed != 0)
if (last_changed != 0) {
changed_lines(first_changed, 0,
oap->is_VIsual ? start_lnum + oap->line_count :
last_changed + 1, 0L, true);
else if (oap->is_VIsual)
} else if (oap->is_VIsual) {
redraw_curbuf_later(INVERTED);
}
if (oap->line_count > p_report) {
i = oap->line_count - (i + 1);
@@ -1856,8 +1857,9 @@ void op_tilde(oparg_T *oap)
did_change |= one_change;
}
if (did_change)
if (did_change) {
changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L, true);
}
} else { // not block mode
if (oap->motion_type == kMTLineWise) {
oap->start.col = 0;

View File

@@ -2030,7 +2030,7 @@ void undo_time(long step, int sec, int file, int absolute)
break;
curbuf->b_u_curhead = uhp;
u_undoredo(true, true);
uhp->uh_walk = nomark; /* don't go back down here */
uhp->uh_walk = nomark; // don't go back down here
}
/*