Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions linux.mak
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ $O/termio.o: $S/termio.d
$O/url.o: $S/url.d
$(DMD) -c $(DFLAGS) $S/url.d

$O/utf.o: $S/utf.d
$(DMD) -c $(DFLAGS) $S/utf.d

$O/window.o: $S/window.d
$(DMD) -c $(DFLAGS) $S/window.d

Expand Down
13 changes: 5 additions & 8 deletions src/med/console.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@

module console;

version (Windows)
{

import std.stdio;
import core.stdc.stdlib;
import core.stdc.string;
import core.sys.windows.windows;
import core.sys.windows.winuser;

import ed;
import disp;

version (Windows)
{
import core.sys.windows.windows;
import core.sys.windows.winuser;

enum BEL = 0x07; /* BEL character. */
enum ESC = 0x1B; /* ESC character. */


static HANDLE hStdin; // console input handle
static DWORD fdwSaveOldMode;

Expand Down Expand Up @@ -487,5 +485,4 @@ int help(bool f, int n)
return ed.FALSE;
}

}

} // Windows version
12 changes: 7 additions & 5 deletions src/med/display.d
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,15 @@ int coltodoto(LINE* lp, int col)
{
size_t len = llength(lp);
size_t i = 0;
int ii = 0;
while (i < len)
{
if (getcol(lp,i) >= col)
return i;
ii = cast(int) i;
if (getcol(lp, ii) >= col)
return ii;
decodeUTF8(lp.l_text, i);
}
return i;
return ii;
}

/***********************
Expand Down Expand Up @@ -591,12 +593,12 @@ Lout:
}
if (inmark == 2)
inmark = 0;
if (!nextLine)
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's broken on Windows.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I can't remember typing in that ... No idea how that sneaked in! :)

lp = lforw(lp);
}
vteeol(wp.w_startcol);
++i;
if (!nextLine)
break;
}
}
debug (WFDEBUG)
Expand Down
1 change: 1 addition & 0 deletions src/med/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import display;
import terminal;
import line;
import mouse;
import console; // help

int currow; /* Working cursor row */
int fillcol; /* Current fill column */
Expand Down
1 change: 1 addition & 0 deletions src/med/url.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module url;

import core.stdc.stdio;
import core.stdc.ctype;
Expand Down
2 changes: 1 addition & 1 deletion src/med/utf.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

module utf;

/* This version of microEmacs is based on the public domain C
* version written by Dave G. Conroy.
Expand Down
10 changes: 10 additions & 0 deletions src/med/xterm.d
Original file line number Diff line number Diff line change
Expand Up @@ -596,4 +596,14 @@ debug
}
}

import std.process: spawnProcess;

int help(bool f, int n)
{
printf("\nhelp \n");
auto dmdPid = spawnProcess(["xdg-open", "me.html"]);

return ed.FALSE;
}

} // Posix version