diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-19 11:27:55 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-19 11:27:55 +0200 |
| commit | f212b9d4952c87052e23b5161195917410b7c911 (patch) | |
| tree | 238e6fdefac447230b556779870dde4baa466247 /editor.h | |
| parent | def913f428365d048ce30d71117421acbf379a75 (diff) | |
| download | vis-f212b9d4952c87052e23b5161195917410b7c911.tar.gz vis-f212b9d4952c87052e23b5161195917410b7c911.tar.xz | |
Implement expand tab functionality, make tabwidth configurable
If expandtab is enabled then inserted tabs are replaced by tabwidth
amount of spaces.
Both settings apply to all windows files and can be changed via:
:set tabwidth n # where 1 <= n <= 8
:set expandtab (1|yes|true)|(0|no|false)
Diffstat (limited to 'editor.h')
| -rw-r--r-- | editor.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -99,6 +99,8 @@ struct Editor { Regex *search_pattern; /* last used search pattern */ void (*windows_arrange)(Editor*); /* current layout which places the windows */ void (*statusbar)(EditorWin*); /* configurable user hook to draw statusbar */ + int tabwidth; /* how many spaces should be used to display a tab */ + bool expandtab; /* whether typed tabs should be converted to spaces */ }; Editor *editor_new(int width, int height); @@ -116,6 +118,10 @@ void editor_delete_key(Editor*); void editor_insert(Editor*, size_t pos, const char *data, size_t len); void editor_delete(Editor*, size_t pos, size_t len); +/* set tabwidth (must be in range [1, 8], affects all windows */ +void editor_tabwidth_set(Editor*, int tabwidth); +int editor_tabwidth_get(Editor*); + /* load a set of syntax highlighting definitions which will be associated * to the underlying window based on the file type loaded. * |
