mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fold: use_level,maybe_small are bool
use_levelp, maybe_smallp in check_closed() are bool ptrs.
This commit is contained in:
parent
44cb491f6e
commit
c0dbd8df95
@ -167,8 +167,8 @@ bool hasFoldingWin(
|
|||||||
int x;
|
int x;
|
||||||
fold_T *fp;
|
fold_T *fp;
|
||||||
int level = 0;
|
int level = 0;
|
||||||
int use_level = FALSE;
|
bool use_level = false;
|
||||||
int maybe_small = FALSE;
|
bool maybe_small = false;
|
||||||
garray_T *gap;
|
garray_T *gap;
|
||||||
int low_level = 0;
|
int low_level = 0;
|
||||||
|
|
||||||
@ -673,8 +673,7 @@ deleteFold(
|
|||||||
garray_T *found_ga;
|
garray_T *found_ga;
|
||||||
fold_T *found_fp = NULL;
|
fold_T *found_fp = NULL;
|
||||||
linenr_T found_off = 0;
|
linenr_T found_off = 0;
|
||||||
int use_level;
|
bool maybe_small = false;
|
||||||
int maybe_small = FALSE;
|
|
||||||
int level = 0;
|
int level = 0;
|
||||||
linenr_T lnum = start;
|
linenr_T lnum = start;
|
||||||
linenr_T lnum_off;
|
linenr_T lnum_off;
|
||||||
@ -689,7 +688,7 @@ deleteFold(
|
|||||||
gap = &curwin->w_folds;
|
gap = &curwin->w_folds;
|
||||||
found_ga = NULL;
|
found_ga = NULL;
|
||||||
lnum_off = 0;
|
lnum_off = 0;
|
||||||
use_level = FALSE;
|
bool use_level = false;
|
||||||
for (;; ) {
|
for (;; ) {
|
||||||
if (!foldFind(gap, lnum - lnum_off, &fp))
|
if (!foldFind(gap, lnum - lnum_off, &fp))
|
||||||
break;
|
break;
|
||||||
@ -846,8 +845,6 @@ foldMoveTo(
|
|||||||
linenr_T lnum_off;
|
linenr_T lnum_off;
|
||||||
linenr_T lnum_found;
|
linenr_T lnum_found;
|
||||||
linenr_T lnum;
|
linenr_T lnum;
|
||||||
int use_level;
|
|
||||||
int maybe_small;
|
|
||||||
garray_T *gap;
|
garray_T *gap;
|
||||||
fold_T *fp;
|
fold_T *fp;
|
||||||
int level;
|
int level;
|
||||||
@ -861,8 +858,8 @@ foldMoveTo(
|
|||||||
* that moves the cursor is used. */
|
* that moves the cursor is used. */
|
||||||
lnum_off = 0;
|
lnum_off = 0;
|
||||||
gap = &curwin->w_folds;
|
gap = &curwin->w_folds;
|
||||||
use_level = FALSE;
|
bool use_level = false;
|
||||||
maybe_small = FALSE;
|
bool maybe_small = false;
|
||||||
lnum_found = curwin->w_cursor.lnum;
|
lnum_found = curwin->w_cursor.lnum;
|
||||||
level = 0;
|
level = 0;
|
||||||
last = FALSE;
|
last = FALSE;
|
||||||
@ -1506,9 +1503,9 @@ static int getDeepestNestingRecurse(garray_T *gap)
|
|||||||
static bool check_closed(
|
static bool check_closed(
|
||||||
win_T *const win,
|
win_T *const win,
|
||||||
fold_T *const fp,
|
fold_T *const fp,
|
||||||
int *const use_levelp, // TRUE: outer fold had FD_LEVEL
|
bool *const use_levelp, // true: outer fold had FD_LEVEL
|
||||||
const int level, // folding depth
|
const int level, // folding depth
|
||||||
int *const maybe_smallp, // TRUE: outer this had fd_small == kNone
|
bool *const maybe_smallp, // true: outer this had fd_small == kNone
|
||||||
const linenr_T lnum_off // line number offset for fp->fd_top
|
const linenr_T lnum_off // line number offset for fp->fd_top
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1517,7 +1514,7 @@ static bool check_closed(
|
|||||||
/* Check if this fold is closed. If the flag is FD_LEVEL this
|
/* Check if this fold is closed. If the flag is FD_LEVEL this
|
||||||
* fold and all folds it contains depend on 'foldlevel'. */
|
* fold and all folds it contains depend on 'foldlevel'. */
|
||||||
if (*use_levelp || fp->fd_flags == FD_LEVEL) {
|
if (*use_levelp || fp->fd_flags == FD_LEVEL) {
|
||||||
*use_levelp = TRUE;
|
*use_levelp = true;
|
||||||
if (level >= win->w_p_fdl) {
|
if (level >= win->w_p_fdl) {
|
||||||
closed = true;
|
closed = true;
|
||||||
}
|
}
|
||||||
@ -1527,7 +1524,7 @@ static bool check_closed(
|
|||||||
|
|
||||||
// Small fold isn't closed anyway.
|
// Small fold isn't closed anyway.
|
||||||
if (fp->fd_small == kNone) {
|
if (fp->fd_small == kNone) {
|
||||||
*maybe_smallp = TRUE;
|
*maybe_smallp = true;
|
||||||
}
|
}
|
||||||
if (closed) {
|
if (closed) {
|
||||||
if (*maybe_smallp) {
|
if (*maybe_smallp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user