“Smart tabs” sound better, a quick look at configuration files for both vim
and sublime text
:
Vim
---
noexpandtab
tabstop
smartindent
smarttab
Sublime Text
------------
tab_size
translate_tabs_to_spaces
use_tab_stops
...
smarttab
in vim is used to respect <BS>
character in some circumstances. For example if a tab key is to insert 4 spaces, a <BS>
will delete 4 spaces if it is performed after smartindent
/expandtab
inserts 4 spaces in front of a line.
In the case of EpicEditor, we are combining some of these features into one option:
- Enable tab key (and shift-tab);
- Don't expand tab to spaces (and use css: tab-size instead) – I think expansion of tabs could be useful, but may introduce too many options/variables. But it is something we can discuss: my position is to keep it simple, at least for this first implementation. But I will experiment with this, keen to see how this will work;
- By enabling tab key, we introduce smart indentation (rule where previous lines' indentation is respected).
What I can do is try and experiment with internal options such as smartIndentation
, smartTabs
, expandTab
and see how they pull up together. I am quite keen on seeing how others implement this first.
We can always change the name later on. I'll keep it as smartTabs
for now.
Progress report, TLDR; TAB will have to wait until we get this
\n
sorted. The pure text version will make a lot of things easier! (I think).Preliminary newline (
\n
) support is infeature/newline
To do for this feature (listed in order):
develop
andfeature/newline
is not pretty. Even if I rebase, I will need tinker with my code. But it needs to be done;newline
function so that issue #162 can be addressed;textContent
toinnerText
;Proposed workflow for getting TAB in to main branch:
feature/newline
feature/indentation
andfeature/paste
and it will reuse some of the new API methods introduced infeature/newline
This will keep things branch/merging quite linear and pretty.