mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
fold: add const to deleteFold() variables
Declare and initialize variables on same line if possible.
This commit is contained in:
@@ -659,34 +659,30 @@ void foldCreate(linenr_T start, linenr_T end)
|
|||||||
* When "end" is not 0, delete all folds from "start" to "end".
|
* When "end" is not 0, delete all folds from "start" to "end".
|
||||||
* When "recursive" is TRUE delete recursively.
|
* When "recursive" is TRUE delete recursively.
|
||||||
*/
|
*/
|
||||||
void
|
void deleteFold(
|
||||||
deleteFold(
|
const linenr_T start,
|
||||||
linenr_T start,
|
const linenr_T end,
|
||||||
linenr_T end,
|
const int recursive,
|
||||||
int recursive,
|
const bool had_visual // true when Visual selection used
|
||||||
int had_visual // TRUE when Visual selection used
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
garray_T *gap;
|
|
||||||
fold_T *fp;
|
fold_T *fp;
|
||||||
garray_T *found_ga;
|
|
||||||
fold_T *found_fp = NULL;
|
fold_T *found_fp = NULL;
|
||||||
linenr_T found_off = 0;
|
linenr_T found_off = 0;
|
||||||
bool maybe_small = false;
|
bool maybe_small = false;
|
||||||
int level = 0;
|
int level = 0;
|
||||||
linenr_T lnum = start;
|
linenr_T lnum = start;
|
||||||
linenr_T lnum_off;
|
bool did_one = false;
|
||||||
int did_one = FALSE;
|
|
||||||
linenr_T first_lnum = MAXLNUM;
|
linenr_T first_lnum = MAXLNUM;
|
||||||
linenr_T last_lnum = 0;
|
linenr_T last_lnum = 0;
|
||||||
|
|
||||||
checkupdate(curwin);
|
checkupdate(curwin);
|
||||||
|
|
||||||
while (lnum <= end) {
|
while (lnum <= end) {
|
||||||
/* Find the deepest fold for "start". */
|
// Find the deepest fold for "start".
|
||||||
gap = &curwin->w_folds;
|
garray_T *gap = &curwin->w_folds;
|
||||||
found_ga = NULL;
|
garray_T *found_ga = NULL;
|
||||||
lnum_off = 0;
|
linenr_T lnum_off = 0;
|
||||||
bool use_level = false;
|
bool use_level = false;
|
||||||
for (;; ) {
|
for (;; ) {
|
||||||
if (!foldFind(gap, lnum - lnum_off, &fp))
|
if (!foldFind(gap, lnum - lnum_off, &fp))
|
||||||
@@ -723,7 +719,7 @@ deleteFold(
|
|||||||
parseMarker(curwin);
|
parseMarker(curwin);
|
||||||
deleteFoldMarkers(found_fp, recursive, found_off);
|
deleteFoldMarkers(found_fp, recursive, found_off);
|
||||||
}
|
}
|
||||||
did_one = TRUE;
|
did_one = true;
|
||||||
|
|
||||||
/* redraw window */
|
/* redraw window */
|
||||||
changed_window_setting();
|
changed_window_setting();
|
||||||
|
Reference in New Issue
Block a user