D - dedit suggestion / patch
- Lloyd Dupont (16/16) Nov 22 2002 well, sorry for the very naive suggestion (I'm both new to D & dedit)
- Lloyd Dupont (1/1) Nov 22 2002 line number would be cool... :-)
- Lloyd Dupont (42/42) Nov 22 2002 I tried hard to use tab ('\t') in dedit.
- Burton Radons (3/5) Nov 27 2002 I'll put in global and highlighting options for tab behaviour and a
well, sorry for the very naive suggestion (I'm both new to D & dedit)
I have a patch not perfect but good enough for dedit:
// === in view.d
void loadFile (char [] filename)
{
// main code
// I add this
global.root.addDocument(document);
doclist.paint ();
}
//=====
recompile, oups dmd 0.50 has a lot of surprise...
and it worked !
I open new file and they display on the left...
I could use them now, on.....
Also, how to close a project or start a new one ?
Nov 22 2002
I tried hard to use tab ('\t') in dedit.
absolutly necessary to write any makefile....
if I make the followind modification it nearly work correctly
// === main_comands.d ==
void Indent (View view)
{
with (view.document)
{
char [] l = lines [line];
char [] i;
//i.length = (offset + view.indentsize) / view.indentsize *
view.indentsize - offset;
//i [0 .. i.length] = " ";
i = "\t"; // use '\t', no, no space
setLine (line, l [0 .. offset] ~ i ~ l [offset .. l.length]);
offset += i.length;
view.caretChange ();
}
}
// === digcanvas.d ===
void text (int x, int y, char [] string)
{
RECT rect;
rect.left = x;
rect.top = y;
rect.right = x + 64000;
rect.bottom = y + 640;
// TabbedTextOutA() instead of DrawTextA
TabbedTextOutA(hdc, x, y, string, string.length, 0, null, 0);
}
// ===============
of course I add to i need to import these functions:
//===========
extern (Windows)
{
export LONG TabbedTextOutA(HDC,int,int,LPCSTR,int,int,LPINT,int);
export LONG TabbedTextOutW(HDC,int,int,LPCWSTR,int,int,LPINT,int);
}
//===========
the (mysterious) problem is, the cursor is half a character mispositioned by
tab in lines where there is a tab, obviously due to baseX (baseX=0 solve
the problem), but I don't see how...
Nov 22 2002
Lloyd Dupont wrote:
I tried hard to use tab ('\t') in dedit.
absolutly necessary to write any makefile....
I'll put in global and highlighting options for tab behaviour and a
makefile highlighter.
Nov 27 2002









"Lloyd Dupont" <lloyd galador.net> 