From d24bc4a3670c253fad5bee380c35e8a45dd283a2 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 11 Feb 2015 06:01:25 +0100 Subject: implemented support for different indention styles * the ^I command was altered to insert indention characters rather than plain tabs always. * The immediate editing command was added for all insertion arguments (I, ^I but also FR and FS) * documentation was extended for a discussion of indention --- src/cmdline.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/cmdline.cpp') diff --git a/src/cmdline.cpp b/src/cmdline.cpp index 39cec52..dc03d9c 100644 --- a/src/cmdline.cpp +++ b/src/cmdline.cpp @@ -219,7 +219,17 @@ process_edit_cmd(gchar key) break; case '\t': - if (States::is_file()) { + if (States::is_insertion()) { + if (!interface.ssm(SCI_GETUSETABS)) { + gint len = interface.ssm(SCI_GETTABWIDTH); + + len -= interface.ssm(SCI_GETCOLUMN, + interface.ssm(SCI_GETCURRENTPOS)) % len; + + memset(insert, ' ', len); + insert[len] = '\0'; + } + } else if (States::is_file()) { *insert = '\0'; if (interface.popup_is_shown()) { /* cycle through popup pages */ -- cgit v1.2.3