Functions | Variables
context.c File Reference
#include "nvim/context.h"
#include "nvim/eval/encode.h"
#include "nvim/ex_docmd.h"
#include "nvim/option.h"
#include "nvim/shada.h"
#include "nvim/api/vim.h"
#include "nvim/api/private/helpers.h"

Functions

void ctx_free_all (void)
 Clears and frees the context stack. More...
 
size_t ctx_size (void)
 Returns the size of the context stack. More...
 
Contextctx_get (size_t index)
 
void ctx_free (Context *ctx) FUNC_ATTR_NONNULL_ALL
 
void ctx_save (Context *ctx, const int flags)
 
bool ctx_restore (Context *ctx, const int flags)
 
Dictionary ctx_to_dict (Context *ctx) FUNC_ATTR_NONNULL_ALL
 
int ctx_from_dict (Dictionary dict, Context *ctx) FUNC_ATTR_NONNULL_ALL
 

Variables

int kCtxAll
 

Function Documentation

void ctx_free ( Context ctx)

Free resources used by Context object.

param[in] ctx pointer to Context object to free.

void ctx_free_all ( void  )

Clears and frees the context stack.

int ctx_from_dict ( Dictionary  dict,
Context ctx 
)

Converts Dictionary representation of Context back to Context object.

Parameters
[in]dictContext Dictionary representation.
[out]ctxContext object to store conversion result into.
Returns
types of included context items.
Context* ctx_get ( size_t  index)

Returns pointer to Context object with given zero-based index from the top of context stack or NULL if index is out of bounds.

bool ctx_restore ( Context ctx,
const int  flags 
)

Restores the editor state from a context.

If "context" is NULL, pops context from context stack. Use "flags" to select particular types of context.

Parameters
ctxRestore from this context. Pop from context stack if NULL.
flagsFlags, see ContextTypeFlags enum.
Returns
true on success, false otherwise (i.e.: empty context stack).
void ctx_save ( Context ctx,
const int  flags 
)

Saves the editor state to a context.

If "context" is NULL, pushes context on context stack. Use "flags" to select particular types of context.

Parameters
ctxSave to this context, or push on context stack if NULL.
flagsFlags, see ContextTypeFlags enum.
size_t ctx_size ( void  )

Returns the size of the context stack.

Dictionary ctx_to_dict ( Context ctx)

Converts Context to Dictionary representation.

Parameters
[in]ctxContext to convert.
Returns
Dictionary representing "ctx".

Variable Documentation

int kCtxAll
Initial value:
Registers.
Definition: context.h:32
Functions.
Definition: context.h:37
Buffer list.
Definition: context.h:34
Global variables.
Definition: context.h:35
Jumplist.
Definition: context.h:33
Script functions.
Definition: context.h:36