git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#35 support emoji in tterminal
[fanfix.git]
/
src
/
jexer
/
TField.java
diff --git
a/src/jexer/TField.java
b/src/jexer/TField.java
index 7b17ba87f7720da099233799792fed28a7572930..3d727ea17ce1d19003646ec6091570e6173bb860 100644
(file)
--- a/
src/jexer/TField.java
+++ b/
src/jexer/TField.java
@@
-47,7
+47,7
@@
public class TField extends TWidget {
/**
* Background character for unfilled-in text.
*/
/**
* Background character for unfilled-in text.
*/
- protected
char
backgroundChar = GraphicsChars.HATCH;
+ protected
int
backgroundChar = GraphicsChars.HATCH;
/**
* Field text.
/**
* Field text.
@@
-412,7
+412,7
@@
public class TField extends TWidget {
*
* @return background character
*/
*
* @return background character
*/
- public final
char
getBackgroundChar() {
+ public final
int
getBackgroundChar() {
return backgroundChar;
}
return backgroundChar;
}
@@
-421,7
+421,7
@@
public class TField extends TWidget {
*
* @param backgroundChar the background character
*/
*
* @param backgroundChar the background character
*/
- public void setBackgroundChar(final
char
backgroundChar) {
+ public void setBackgroundChar(final
int
backgroundChar) {
this.backgroundChar = backgroundChar;
}
this.backgroundChar = backgroundChar;
}
@@
-521,9
+521,9
@@
public class TField extends TWidget {
/**
* Append char to the end of the field.
*
/**
* Append char to the end of the field.
*
- * @param ch
=
char to append
+ * @param ch char to append
*/
*/
- protected void appendChar(final
char
ch) {
+ protected void appendChar(final
int
ch) {
// Append the LAST character
text += ch;
position++;
// Append the LAST character
text += ch;
position++;
@@
-548,8
+548,8
@@
public class TField extends TWidget {
*
* @param ch char to append
*/
*
* @param ch char to append
*/
- protected void insertChar(final
char
ch) {
- text = text.substring(0, position) +
ch
+ text.substring(position);
+ protected void insertChar(final
int
ch) {
+ text = text.substring(0, position) +
((char) ch)
+ text.substring(position);
position++;
screenPosition += StringUtils.width(ch);
if ((screenPosition - windowStart) == getWidth()) {
position++;
screenPosition += StringUtils.width(ch);
if ((screenPosition - windowStart) == getWidth()) {