aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-19 11:27:55 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-19 11:27:55 +0200
commitf212b9d4952c87052e23b5161195917410b7c911 (patch)
tree238e6fdefac447230b556779870dde4baa466247 /editor.h
parentdef913f428365d048ce30d71117421acbf379a75 (diff)
downloadvis-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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor.h b/editor.h
index 3b750e9..5eeab8e 100644
--- a/editor.h
+++ b/editor.h
@@ -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.
*