Schim
Public Member Functions | List of all members
Vim::Count Class Reference

Representation of a vim-count. More...

#include <vim.h>

Public Member Functions

 Count (int count)
 Construct a vim-count. More...
 
 operator int () const
 Conversion to integer. More...
 
int raw () const
 Get the raw count from this Count.
 

Detailed Description

Representation of a vim-count.

When the user inputs a key sequence, usually a count can also be specified. This count determines how many times the command will be repeated. An unspecified count is equal to Count(0).

Different commands will treat a 0-count differently. Some commands equate a 0-count with a 1-count, others treat it in some special way. This class provides a uniform interface for each use case.

Casting a Vim::Count to an int yields a basic count, i.e. int(Count(0)) == 1. On the other hand, raw() yields the raw count, i.e. Count(0).raw() == 0.

Note
For non-zero counts, int() and raw() are equivalent.
See also
Vim::N

Constructor & Destructor Documentation

◆ Count()

Vim::Count::Count ( int  count)

Construct a vim-count.

Parameters
countThe raw vim-count.

Member Function Documentation

◆ operator int()

Vim::Count::operator int ( ) const

Conversion to integer.

Returns
The basic count.

The documentation for this class was generated from the following file: