Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
8723c9c5
Commit
8723c9c5
authored
Aug 24, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed crash in cursor movement code when adding keyword parameter
parent
4f04d1c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/gui/value/text.cpp
src/gui/value/text.cpp
+3
-1
No files found.
src/gui/value/text.cpp
View file @
8723c9c5
...
@@ -868,6 +868,8 @@ void TextValueEditor::insert(const String& text, const String& action_name) {
...
@@ -868,6 +868,8 @@ void TextValueEditor::insert(const String& text, const String& action_name) {
/// compare two cursor positions, determine how much the text matches before and after
/// compare two cursor positions, determine how much the text matches before and after
size_t
match_cursor_position
(
size_t
pos1
,
const
String
&
text1
,
size_t
pos2
,
const
String
&
text2
)
{
size_t
match_cursor_position
(
size_t
pos1
,
const
String
&
text1
,
size_t
pos2
,
const
String
&
text2
)
{
pos1
=
min
(
pos1
,
text1
.
size
());
pos2
=
min
(
pos2
,
text2
.
size
());
size_t
score
=
0
;
// total score
size_t
score
=
0
;
// total score
// Match part before cursor
// Match part before cursor
size_t
before1
,
before2
;
size_t
before1
,
before2
;
...
@@ -915,7 +917,7 @@ void TextValueEditor::replaceSelection(const String& replacement, const String&
...
@@ -915,7 +917,7 @@ void TextValueEditor::replaceSelection(const String& replacement, const String&
}
}
// what we would expect if no scripts take place
// what we would expect if no scripts take place
String
expected_value
=
untag_for_cursor
(
action
->
newValue
());
String
expected_value
=
untag_for_cursor
(
action
->
newValue
());
size_t
expected_cursor
=
min
(
selection_start
,
selection_end
)
+
untag
(
replacement
).
size
();
size_t
expected_cursor
=
min
(
selection_start
,
selection_end
)
+
untag
_for_cursor
(
replacement
).
size
();
// perform the action
// perform the action
// NOTE: this calls our onAction, invalidating the text viewer and moving the selection around the new text
// NOTE: this calls our onAction, invalidating the text viewer and moving the selection around the new text
addAction
(
action
);
addAction
(
action
);
...
...
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