diff options
author | Thomas Otto <th1000s@posteo.net> | 2023-05-31 19:17:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 13:17:18 -0400 |
commit | 139cdb9656292edba917fd6addc0a7960cf60342 (patch) | |
tree | d598b6663e03ebd5f54d2198b00df4d00d25c893 /src/cli.rs | |
parent | 65418aaa3bc064dc7ce34e6d2f231b96a5c6acb9 (diff) |
Misc tab refactoring (#1424)
* Move tabs logic into utils
* Re-use buffer returned by tabs::expand
* Add TabCfg to configure tabs
Use the String from this config for the tab replacement. This avoids
creating a new String for each processed line.
* Avoid unicode segmentation for each line just to remove a prefix
In some code paths no prefix is removed, and in almost all other
cases the prefix is just ascii.
This simplifies a lot of calls.
* Set default tab with to 8
Editors like vim, emacs, nano and most terminal emulators set
this value as the default tab display width.
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -935,7 +935,7 @@ pub struct Opt { /// syntax highlighting. pub syntax_theme: Option<String>, - #[arg(long = "tabs", default_value = "4", value_name = "N")] + #[arg(long = "tabs", default_value = "8", value_name = "N")] /// The number of spaces to replace tab characters with. /// /// Use --tabs=0 to pass tab characters through directly, but note that in that case delta will |