#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) |
like win_chartabsize(), but also check for line breaks on the screen
line | |
s | |
col |
Call lbr_chartabsize() and advance the pointer.
line | |
s | |
col |
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.
s |
int linetabsize_col | ( | int | startcol, |
char_u * | s | ||
) |
Like linetabsize(), but starting at column "startcol".
startcol | |
s |
Functions calculating vertical size of text when displayed inside a window. Calls horizontal size functions defined below.
winheight | when true limit to window height |
Like plines_win(), but only reports the number of physical screen lines used from the start of the line to the given column number.
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.
[in] | wp | window line is in |
[in] | lnum | line number |
[out] | nextp | if not NULL, the line after a fold |
[out] | foldedp | if not NULL, whether lnum is on a fold |
[in] | cache | whether to use the window's cache for folds |
winheight | when true limit to window height |
@Return number of window lines physical line "lnum" will occupy in window "wp". Does not care about folding, 'wrap' or 'diff'.
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()
p | |
col |
Return the number of filler lines above "lnum".
wp | |
lnum |
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.
wp | |
line | |
s | |
col | |
headp |
Like linetabsize(), but for a given window instead of the current one.
wp | |
line | |
len |