Data Structures | Macros | Functions
tui.c File Reference
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <unibilium.h>
#include <uv.h>
#include "nvim/api/private/helpers.h"
#include "nvim/api/vim.h"
#include "nvim/ascii.h"
#include "nvim/event/loop.h"
#include "nvim/event/signal.h"
#include "nvim/highlight.h"
#include "nvim/lib/kvec.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/map.h"
#include "nvim/memory.h"
#include "nvim/option.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/signal.h"
#include "nvim/os/tty.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
#include "nvim/cursor_shape.h"
#include "nvim/macros.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/tui/input.h"
#include "nvim/tui/terminfo.h"
#include "nvim/tui/tui.h"
#include "nvim/ugrid.h"
#include "nvim/ui_bridge.h"

Data Structures

struct  Rect
 
struct  TUIData
 

Macros

#define CNORM_COMMAND_MAX_SIZE   32
 
#define OUTBUF_SIZE   0xffff
 
#define TOO_MANY_EVENTS   1000000
 
#define STARTS_WITH(str, prefix)
 
#define TMUX_WRAP(is_tmux, seq)   ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq)
 
#define LINUXSET0C   "\x1b[?0c"
 
#define LINUXSET1C   "\x1b[?1c"
 
#define UNIBI_SET_NUM_VAR(var, num)   (var).i = (num);
 
#define UNIBI_OUT(fn)
 
#define XTERM_SETAF_256_COLON   "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38:5:%p1%d%;m"
 
#define XTERM_SETAB_256_COLON   "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48:5:%p1%d%;m"
 
#define XTERM_SETAF_256   "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m"
 
#define XTERM_SETAB_256   "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m"
 
#define XTERM_SETAF_16   "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e39%;m"
 
#define XTERM_SETAB_16   "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e39%;m"
 

Functions

UItui_start (void)
 
CursorShape tui_cursor_decode_shape (const char *shape_str)
 

Macro Definition Documentation

◆ CNORM_COMMAND_MAX_SIZE

#define CNORM_COMMAND_MAX_SIZE   32

◆ LINUXSET0C

#define LINUXSET0C   "\x1b[?0c"

◆ LINUXSET1C

#define LINUXSET1C   "\x1b[?1c"

◆ OUTBUF_SIZE

#define OUTBUF_SIZE   0xffff

◆ STARTS_WITH

#define STARTS_WITH (   str,
  prefix 
)
Value:
(strlen(str) >= (sizeof(prefix) - 1) \
&& 0 == memcmp((str), (prefix), sizeof(prefix) - 1))

◆ TMUX_WRAP

#define TMUX_WRAP (   is_tmux,
  seq 
)    ((is_tmux) ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq)

◆ TOO_MANY_EVENTS

#define TOO_MANY_EVENTS   1000000

◆ UNIBI_OUT

#define UNIBI_OUT (   fn)
Value:
do { \
TUIData *data = ui->data; \
const char *str = NULL; \
if (unibi_index >= 0) { \
str = fn(data->ut, (unsigned)unibi_index); \
} \
if (str) { \
unibi_var_t vars[26 + 26]; \
size_t orig_pos = data->bufpos; \
memset(&vars, 0, sizeof(vars)); \
data->cork = true; \
retry: \
unibi_format(vars, vars + 26, str, data->params, out, ui, NULL, NULL); \
if (data->overflow) { \
data->bufpos = orig_pos; \
flush_buf(ui); \
goto retry; \
} \
data->cork = false; \
} \
} while (0)

◆ UNIBI_SET_NUM_VAR

#define UNIBI_SET_NUM_VAR (   var,
  num 
)    (var).i = (num);

◆ XTERM_SETAB_16

#define XTERM_SETAB_16   "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e39%;m"

◆ XTERM_SETAB_256

#define XTERM_SETAB_256   "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m"

◆ XTERM_SETAB_256_COLON

#define XTERM_SETAB_256_COLON   "\x1b[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48:5:%p1%d%;m"

◆ XTERM_SETAF_16

#define XTERM_SETAF_16   "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e39%;m"

◆ XTERM_SETAF_256

#define XTERM_SETAF_256   "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m"

◆ XTERM_SETAF_256_COLON

#define XTERM_SETAF_256_COLON   "\x1b[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38:5:%p1%d%;m"

Function Documentation

◆ tui_cursor_decode_shape()

CursorShape tui_cursor_decode_shape ( const char *  shape_str)

◆ tui_start()

UI* tui_start ( void  )
NULL
return NULL
Definition: eval.c:10355