VisualD modding
Johnson Jones via Digitalmars-d-ide
digitalmars-d-ide at puremagic.com
Sun Aug 13 13:43:21 PDT 2017
So, I'd like to fix some of visual D's navigation and editing
logic and possibly implement something like elastic tabs:
http://nickgravgaard.com/elastic-tabstops/
1. Backspace and delete should be tab aligned and use elastic
space.
2. Indention on new line should not add spaces(it currently does
and screws things up as things are no longer aligned and it is
very difficult to realign stuff.
3. Indentation should use previous indentation when using tab or
enter, unless empty line.
I've went ahead and added a property called elasticSpace to
visual D's properties(should be in the tab section I suppose but
I didn't wanna have to figure that mess out).
propertypage: https://justpaste.it/1a1if
dpackage: https://justpaste.it/1a1ig
This do add it to the first entry and defaults it to true but
that can easily be fixed.
The real work is to consume all spaces, working backwards, when
hitting backspace and to consume all spaces forward when hitting
delete. Also dealing with other the tab and enter key
appropriately.
TabSanity uses the code like
https://justpaste.it/1a1ij
Anyways, I'm at the following location in viewfilter.d and a
little lost(well, time constraints).
The backspace key is handled as so:
// Handle backspace
case ECMD_BACKSPACE:
if(mCodeWinMgr.mSource.IsCompletorActive())
initCompletion(false);
if (Package.GetGlobalOptions().elasticSpace)
{
mView.GetCaretPos(&line, &idx);
dchar ch = pvaIn.uiVal;
}
goto case;
in which I've added the new code.
but it's a little difficult to navigate through the code. I think
with the proper mapping maybe it is possible almost directly copy
and paste the tabsanity code.
In any case, I figured I'd let you have a shot at it first if you
want since your probably more familiar with it than me(and since
debugging is extremely slow with this sorta thing I'll probably
burn a lot more time than you would).
Thanks
More information about the Digitalmars-d-ide
mailing list