Functions
plines.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <string.h>
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/decoration.h"
#include "nvim/diff.h"
#include "nvim/fold.h"
#include "nvim/func_attr.h"
#include "nvim/indent.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/move.h"
#include "nvim/option.h"
#include "nvim/plines.h"
#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/vim.h"
#include "nvim/window.h"

Functions

int plines_win (win_T *wp, linenr_T lnum, bool winheight)
 
int win_get_fill (win_T *wp, linenr_T lnum)
 
bool win_may_fill (win_T *wp)
 
int plines_win_nofill (win_T *wp, linenr_T lnum, bool winheight)
 
int plines_win_nofold (win_T *wp, linenr_T lnum)
 
int plines_win_col (win_T *wp, linenr_T lnum, long column)
 
int plines_win_full (win_T *wp, linenr_T lnum, linenr_T *const nextp, bool *const foldedp, const bool cache)
 
int plines_m_win (win_T *wp, linenr_T first, linenr_T last)
 
int win_chartabsize (win_T *wp, char_u *p, colnr_T col)
 Functions calculating horizontal size of text, when displayed in a window. More...
 
int linetabsize (char_u *s)
 
int linetabsize_col (int startcol, char_u *s)
 
unsigned int win_linetabsize (win_T *wp, char_u *line, colnr_T len)
 
int lbr_chartabsize (char_u *line, unsigned char *s, colnr_T col)
 
int lbr_chartabsize_adv (char_u *line, char_u **s, colnr_T col)
 
int win_lbr_chartabsize (win_T *wp, char_u *line, char_u *s, colnr_T col, int *headp)
 

Function Documentation

◆ lbr_chartabsize()

int lbr_chartabsize ( char_u line,
unsigned char *  s,
colnr_T  col 
)

like win_chartabsize(), but also check for line breaks on the screen

Parameters
line
s
col
Returns
The number of characters taken up on the screen.

◆ lbr_chartabsize_adv()

int lbr_chartabsize_adv ( char_u line,
char_u **  s,
colnr_T  col 
)

Call lbr_chartabsize() and advance the pointer.

Parameters
line
s
col
Returns
The number of characters take up on the screen.

◆ linetabsize()

int linetabsize ( char_u s)

Return the number of characters the string 's' will take on the screen, taking into account the size of a tab.

Parameters
s
Returns
Number of characters the string will take on the screen.

◆ linetabsize_col()

int linetabsize_col ( int  startcol,
char_u s 
)

Like linetabsize(), but starting at column "startcol".

Parameters
startcol
s
Returns
Number of characters the string will take on the screen.

◆ plines_m_win()

int plines_m_win ( win_T wp,
linenr_T  first,
linenr_T  last 
)

◆ plines_win()

int plines_win ( win_T wp,
linenr_T  lnum,
bool  winheight 
)

Functions calculating vertical size of text when displayed inside a window. Calls horizontal size functions defined below.

Parameters
winheightwhen true limit to window height

◆ plines_win_col()

int plines_win_col ( win_T wp,
linenr_T  lnum,
long  column 
)

Like plines_win(), but only reports the number of physical screen lines used from the start of the line to the given column number.

◆ plines_win_full()

int plines_win_full ( win_T wp,
linenr_T  lnum,
linenr_T *const  nextp,
bool *const  foldedp,
const bool  cache 
)

Get the number of screen lines lnum takes up. This takes care of both folds and topfill, and limits to the current window height.

Parameters
[in]wpwindow line is in
[in]lnumline number
[out]nextpif not NULL, the line after a fold
[out]foldedpif not NULL, whether lnum is on a fold
[in]cachewhether to use the window's cache for folds
Returns
the total number of screen lines

◆ plines_win_nofill()

int plines_win_nofill ( win_T wp,
linenr_T  lnum,
bool  winheight 
)
Parameters
winheightwhen true limit to window height

◆ plines_win_nofold()

int plines_win_nofold ( win_T wp,
linenr_T  lnum 
)

@Return number of window lines physical line "lnum" will occupy in window "wp". Does not care about folding, 'wrap' or 'diff'.

◆ win_chartabsize()

int win_chartabsize ( win_T wp,
char_u p,
colnr_T  col 
)

Functions calculating horizontal size of text, when displayed in a window.

Return the number of characters 'c' will take on the screen, taking into account the size of a tab. Also see getvcol()

Parameters
p
col
Returns
Number of characters.

◆ win_get_fill()

int win_get_fill ( win_T wp,
linenr_T  lnum 
)

Return the number of filler lines above "lnum".

Parameters
wp
lnum
Returns
Number of filler lines above lnum

◆ win_lbr_chartabsize()

int win_lbr_chartabsize ( win_T wp,
char_u line,
char_u s,
colnr_T  col,
int *  headp 
)

This function is used very often, keep it fast!!!!

If "headp" not NULL, set *headp to the size of what we for 'showbreak' string at start of line. Warning: *headp is only set if it's a non-zero value, init to 0 before calling.

Parameters
wp
line
s
col
headp
Returns
The number of characters taken up on the screen.

◆ win_linetabsize()

unsigned int win_linetabsize ( win_T wp,
char_u line,
colnr_T  len 
)

Like linetabsize(), but for a given window instead of the current one.

Parameters
wp
line
len
Returns
Number of characters the string will take on the screen.

◆ win_may_fill()

bool win_may_fill ( win_T wp)