Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c005b98d
Commit
c005b98d
authored
Oct 04, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Oct 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add an option to move the cursor to after the final end-of-paragraph.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4c322698
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
caret.c
dlls/riched20/caret.c
+9
-10
No files found.
dlls/riched20/caret.c
View file @
c005b98d
...
...
@@ -31,11 +31,11 @@ void ME_SetCursorToStart(ME_TextEditor *editor, ME_Cursor *cursor)
cursor
->
nOffset
=
0
;
}
static
void
ME_SetCursorToEnd
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
static
void
ME_SetCursorToEnd
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
,
BOOL
final_eop
)
{
cursor
->
pPara
=
editor
->
pBuffer
->
pLast
->
member
.
para
.
prev_para
;
cursor
->
pRun
=
ME_FindItemBack
(
editor
->
pBuffer
->
pLast
,
diRun
);
cursor
->
nOffset
=
0
;
cursor
->
nOffset
=
final_eop
?
cursor
->
pRun
->
member
.
run
.
len
:
0
;
}
...
...
@@ -83,7 +83,7 @@ int ME_GetSelection(ME_TextEditor *editor, ME_Cursor **from, ME_Cursor **to)
int
ME_GetTextLength
(
ME_TextEditor
*
editor
)
{
ME_Cursor
cursor
;
ME_SetCursorToEnd
(
editor
,
&
cursor
);
ME_SetCursorToEnd
(
editor
,
&
cursor
,
FALSE
);
return
ME_GetCursorOfs
(
&
cursor
);
}
...
...
@@ -138,8 +138,7 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to)
if
(
from
==
0
&&
to
==
-
1
)
{
ME_SetCursorToStart
(
editor
,
&
editor
->
pCursors
[
1
]);
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
]);
editor
->
pCursors
[
0
].
nOffset
=
editor
->
pCursors
[
0
].
pRun
->
member
.
run
.
len
;
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
],
TRUE
);
ME_InvalidateSelection
(
editor
);
return
len
+
1
;
}
...
...
@@ -193,7 +192,7 @@ int ME_SetSelection(ME_TextEditor *editor, int from, int to)
if
(
selectionEnd
)
{
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
]);
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
]
,
FALSE
);
editor
->
pCursors
[
1
]
=
editor
->
pCursors
[
0
];
ME_InvalidateSelection
(
editor
);
return
len
;
...
...
@@ -686,7 +685,7 @@ int ME_MoveCursorChars(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
if
(
new_offset
>=
ME_GetTextLength
(
editor
))
{
/* new offset at the end of the text */
ME_SetCursorToEnd
(
editor
,
cursor
);
ME_SetCursorToEnd
(
editor
,
cursor
,
FALSE
);
nRelOfs
-=
new_offset
-
ME_GetTextLength
(
editor
);
return
nRelOfs
;
}
...
...
@@ -859,7 +858,7 @@ ME_SelectByType(ME_TextEditor *editor, ME_SelectionType selectionType)
/* Select everything with cursor anchored from the start of the text */
editor
->
nSelectionType
=
stDocument
;
ME_SetCursorToStart
(
editor
,
&
editor
->
pCursors
[
1
]);
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
]);
ME_SetCursorToEnd
(
editor
,
&
editor
->
pCursors
[
0
]
,
FALSE
);
break
;
default:
assert
(
0
);
}
...
...
@@ -1383,7 +1382,7 @@ static void ME_ArrowPageDown(ME_TextEditor *editor, ME_Cursor *pCursor)
if
(
editor
->
vert_si
.
nPos
>=
y
-
editor
->
sizeWindow
.
cy
)
{
ME_SetCursorToEnd
(
editor
,
pCursor
);
ME_SetCursorToEnd
(
editor
,
pCursor
,
FALSE
);
editor
->
bCaretAtEnd
=
FALSE
;
}
else
{
ME_DisplayItem
*
pRun
=
pCursor
->
pRun
;
...
...
@@ -1480,7 +1479,7 @@ static void ME_ArrowEnd(ME_TextEditor *editor, ME_Cursor *pCursor)
static
void
ME_ArrowCtrlEnd
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pCursor
)
{
ME_SetCursorToEnd
(
editor
,
pCursor
);
ME_SetCursorToEnd
(
editor
,
pCursor
,
FALSE
);
editor
->
bCaretAtEnd
=
FALSE
;
}
...
...
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