Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
68fb8c55
Commit
68fb8c55
authored
Aug 03, 2015
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Restore the original console edit mode on Enter press, if the Insert…
kernel32: Restore the original console edit mode on Enter press, if the Insert key toggle is active.
parent
a6bf7bb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
editline.c
dlls/kernel32/editline.c
+7
-15
No files found.
dlls/kernel32/editline.c
View file @
68fb8c55
...
...
@@ -68,6 +68,7 @@ typedef struct WCEL_Context {
can_wrap
:
1
,
/* to 1 when multi-line edition can take place */
shall_echo
:
1
,
/* to 1 when characters should be echo:ed when keyed-in */
insert
:
1
,
/* to 1 when new characters are inserted (otherwise overwrite) */
insertkey
:
1
,
/* to 1 when the Insert key toggle is active */
can_pos_cursor
:
1
;
/* to 1 when console can (re)position cursor */
unsigned
histSize
;
unsigned
histPos
;
...
...
@@ -763,24 +764,13 @@ static void WCEL_RepeatCount(WCEL_Context* ctx)
static
void
WCEL_ToggleInsert
(
WCEL_Context
*
ctx
)
{
DWORD
mode
;
CONSOLE_CURSOR_INFO
cinfo
;
if
(
GetConsoleMode
(
ctx
->
hConIn
,
&
mode
)
&&
GetConsoleCursorInfo
(
ctx
->
hConOut
,
&
cinfo
))
ctx
->
insertkey
=
!
ctx
->
insertkey
;
if
(
GetConsoleCursorInfo
(
ctx
->
hConOut
,
&
cinfo
))
{
if
((
mode
&
(
ENABLE_INSERT_MODE
|
ENABLE_EXTENDED_FLAGS
))
==
(
ENABLE_INSERT_MODE
|
ENABLE_EXTENDED_FLAGS
))
{
mode
&=
~
ENABLE_INSERT_MODE
;
cinfo
.
dwSize
=
100
;
ctx
->
insert
=
FALSE
;
}
else
{
mode
|=
ENABLE_INSERT_MODE
|
ENABLE_EXTENDED_FLAGS
;
cinfo
.
dwSize
=
25
;
ctx
->
insert
=
TRUE
;
}
SetConsoleMode
(
ctx
->
hConIn
,
mode
);
cinfo
.
dwSize
=
ctx
->
insertkey
?
100
:
25
;
SetConsoleCursorInfo
(
ctx
->
hConOut
,
&
cinfo
);
}
}
...
...
@@ -990,6 +980,8 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, BOOL can_pos_cursor)
GetConsoleMode
(
hConsoleIn
,
&
mode
);
ctx
.
insert
=
(
mode
&
(
ENABLE_INSERT_MODE
|
ENABLE_EXTENDED_FLAGS
))
==
(
ENABLE_INSERT_MODE
|
ENABLE_EXTENDED_FLAGS
);
if
(
ctx
.
insertkey
)
ctx
.
insert
=
!
ctx
.
insert
;
if
(
func
)
(
func
)(
&
ctx
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment