projects
/
m17n
/
m17n-lib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87cc440
)
(surrounding_text_handler): Be sure to set surround text
author
handa
<handa>
Fri, 27 Oct 2006 12:23:30 +0000
(12:23 +0000)
committer
handa
<handa>
Fri, 27 Oct 2006 12:23:30 +0000
(12:23 +0000)
even if LEN is zero.
example/medit.c
patch
|
blob
|
history
diff --git
a/example/medit.c
b/example/medit.c
index
f63a5b6
..
d5cadef
100644
(file)
--- a/
example/medit.c
+++ b/
example/medit.c
@@
-2184,7
+2184,7
@@
surrounding_text_handler (MInputContext *ic, MSymbol command)
{
int len = (int) mplist_value (ic->plist);
int pos;
- MText *surround = NULL;
+ MText *surround;
if (len < 0)
{
@@
-2200,11
+2200,10
@@
surrounding_text_handler (MInputContext *ic, MSymbol command)
pos = nchars;
surround = mtext_duplicate (mt, cursor.from, pos);
}
- if (surround)
- {
- mplist_set (ic->plist, Mtext, surround);
- m17n_object_unref (surround);
- }
+ else
+ surround = mtext ();
+ mplist_set (ic->plist, Mtext, surround);
+ m17n_object_unref (surround);
}
else if (command == Minput_delete_surrounding_text)
{