aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawline.c
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-11-12 15:54:54 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-11-13 23:39:56 +0100
commit28f4f3c48498086307ed825d1761edb5789ca0e8 (patch)
tree880d2104092261fe0457b17a9ddda8a6e0f7f2ed /src/nvim/drawline.c
parent48bcc7b9710d6db619b05254ea87f4087cdd9764 (diff)
downloadrneovim-28f4f3c48498086307ed825d1761edb5789ca0e8.tar.gz
rneovim-28f4f3c48498086307ed825d1761edb5789ca0e8.tar.bz2
rneovim-28f4f3c48498086307ed825d1761edb5789ca0e8.zip
refactor: follow style guide
- reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r--src/nvim/drawline.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 5f61848188..11b4e55c5c 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -401,8 +401,6 @@ static void handle_foldcolumn(win_T *wp, winlinevars_T *wlv)
size_t fill_foldcolumn(char *p, win_T *wp, foldinfo_T foldinfo, linenr_T lnum, int *n_closing)
{
int i = 0;
- int level;
- int first_level;
int fdc = compute_foldcolumn(wp, 0); // available cell width
size_t char_counter = 0;
int symbol = 0;
@@ -411,11 +409,11 @@ size_t fill_foldcolumn(char *p, win_T *wp, foldinfo_T foldinfo, linenr_T lnum, i
// Init to all spaces.
memset(p, ' ', MB_MAXCHAR * (size_t)fdc + 1);
- level = foldinfo.fi_level;
+ int level = foldinfo.fi_level;
// If the column is too narrow, we start at the lowest level that
// fits and use numbers to indicate the depth.
- first_level = level - fdc - closed + 1;
+ int first_level = level - fdc - closed + 1;
if (first_level < 1) {
first_level = 1;
}