=== modified file 'src/com/goldencode/p2j/ui/chui/ThinClient.java'
--- old/src/com/goldencode/p2j/ui/chui/ThinClient.java	2025-07-29 12:59:21 +0000
+++ new/src/com/goldencode/p2j/ui/chui/ThinClient.java	2025-08-20 16:23:27 +0000
@@ -15980,16 +15980,13 @@
 
       if (widget instanceof FillIn)
       {
-         FillIn fillin = (FillIn) widget;
-         if (fillin.groupMode)
-         {
-            // Don't change the cursor offset.
-         }
          // fill-in's always reset the cursor on the first position, after the
          // widget is left
-         else if (!fillin.isPendingNoZap() && !((FillInConfig) fillin.config()).disableAutoZap)
+         FillIn fillin = (FillIn) widget;
+         if (!fillin.groupMode && 
+             !fillin.isPendingNoZap() && !((FillInConfig) fillin.config()).disableAutoZap)
          {
-            ((FillIn) widget).setCursorOffset(0);
+            fillin.setCursorOffset(0);
          }
       }
 

=== modified file 'src/com/goldencode/p2j/ui/client/FillIn.java'
--- old/src/com/goldencode/p2j/ui/client/FillIn.java	2025-07-30 14:43:22 +0000
+++ new/src/com/goldencode/p2j/ui/client/FillIn.java	2025-08-20 18:32:52 +0000
@@ -3921,53 +3921,37 @@
     *          was inserted.
     * @param   key
     *          The character which will be inserted.
+    * @param   isChui
+    *          client is executed in ChUI mode 
     * 
     * @return  <code>true</code> if after insertion operation cursor is
     *          allowed to go to the next widget.
     */
    private boolean refill(boolean insert, int key, boolean isChui)
    {
-      if (insert)
-      {
-         if(!isChui)
-         {
-            return handleGUIInsertMode(key);
-         }
-         else
-         {
-            return handleCHUIInsertMode(key);
-         }
-      }
-      // Character was removed
-      else
-      {
-         return handleRemoveMode();
-      }
+      return insert ? isChui ? handleCHUIInsertMode(key) : handleGUIInsertMode(key) : handleRemoveMode();
    }
 
    /**
     * Handle remove case when a character was deleted.
     *
-    * @return   {@code true} Returns "true" if we successfully handled the removal mode.
-    *           {@code false} otherwise.
+    * @return   always {@code true}
     */
    private boolean handleRemoveMode()
    {
-      // Current fill-in text is already updated after deletion.
-      String newTextAfterDeletion = getText();
-      int currentPosition = getCursorOffset();
-
-
       // Handle all fill-in cases. Fore the last Fill-In, we do nothing.
-      if (!isLastInGroup() &&
-          canAppendContentFromNextFillInToCurrentFillIn())
+      if (!isLastInGroup() && canAppendContentFromNextFillInToCurrentFillIn())
       {
+         // Current fill-in text is already updated after deletion.
+         String newTextAfterDeletion = getText();
          // Append content from the next fill-in to the current Fill-in.
-         String newTextAfterShifting = (StringHelper.safeTrimTrailing(newTextAfterDeletion).length() == 0) ?
-               newTextAfterDeletion + StringHelper.safeTrimTrailing(getNextInGroup().getText()) :
-               newTextAfterDeletion + " " + StringHelper.safeTrimTrailing(getNextInGroup().getText());
-
-         updateCurrentContent(newTextAfterShifting, currentPosition);
+         StringBuilder newTextAfterShifting = new StringBuilder(newTextAfterDeletion);
+         if (StringHelper.safeTrimTrailing(newTextAfterDeletion).length() != 0)
+         {
+            newTextAfterShifting.append(' ');
+         }
+         newTextAfterShifting.append(StringHelper.safeTrimTrailing(getNextInGroup().getText()));
+         updateCurrentContent(newTextAfterShifting.toString(), getCursorOffset());
 
          // Shift from the right side to the left side.
          shiftToLeftAllFillInContents();
@@ -3992,14 +3976,16 @@
       // is NOT empty after trailing spaces are removed, a single space (+1) is
       // implicitly added after it before combining with the next FillIn's content.
       // If 'newTextAfterDeletion' IS empty, no space is added, so its effective length is 0.
-      int currentTextSize =  (StringHelper.safeTrimTrailing(newTextAfterDeletion).length() == 0)
+      final int length = StringHelper.safeTrimTrailing(newTextAfterDeletion).length();
+      int currentTextSize =  length == 0
             ? 0
             // If not empty, its effective size includes a trailing space.
-            : StringHelper.safeTrimTrailing(newTextAfterDeletion).length() + 1;
+            : length + 1;
 
       int maxFillInCapacity = config.appFormat.getScreenWidth();
 
-      return StringHelper.safeTrimTrailing(getNextInGroup().getText()).length() + currentTextSize <= maxFillInCapacity;
+      return StringHelper.safeTrimTrailing(getNextInGroup().getText()).length()
+               + currentTextSize <= maxFillInCapacity;
    }
 
 
@@ -4012,17 +3998,17 @@
       while (currentFillIn != null)
       {
          // If is the next fill in is not the last.
-         if (currentFillIn.getNextInGroup() != null)
-         {
-            String textFromLeftSide = currentFillIn.getNextInGroup().getText();
-            currentFillIn.updateCurrentContent(textFromLeftSide, textFromLeftSide.length());
-         }
-         // We are on the last fill-in.
-         else
+         final FillIn<O, C> nextInGroup = currentFillIn.getNextInGroup();
+         if (nextInGroup == null)
          {
             currentFillIn.updateCurrentContent("", 0);
+            
+            return;
          }
-         currentFillIn = currentFillIn.getNextInGroup();
+         
+         String textFromLeftSide = nextInGroup.getText();
+         currentFillIn.updateCurrentContent(textFromLeftSide, textFromLeftSide.length());
+         currentFillIn = nextInGroup;
       }
    }
 
@@ -4042,7 +4028,6 @@
    {
       // Character is about to be inserted
       String originalText = getText();
-      int currentPosition = getCursorOffset();
       int originalTextLengthTrimmed = StringHelper.safeTrimTrailing(originalText).length();
       int maxFillInCapacity = config.appFormat.getScreenWidth();
 
@@ -4052,24 +4037,23 @@
       {
          return handleGroupedFullFillInForSpaceKey();
       }
+      
+      int currentPosition = getCursorOffset();
       // Handle simple insert char.
-      else
-      {
-         if (isWhiteSpaceBeforeCurrentOffset(originalText, currentPosition, maxFillInCapacity))
-         {
-            updateCurrentContent(originalText, originalTextLengthTrimmed);
-            return true;
-         }
-
-         if (shouldPropagateAfterInsertion(originalText, originalTextLengthTrimmed, maxFillInCapacity))
-         {
-            return handlePropagationAfterInsertion(originalText, currentPosition, key);
-         }
-
-         if (canInsertWithoutPropagation(currentPosition, originalTextLengthTrimmed, maxFillInCapacity))
-         {
-            return handleSimpleInsert(originalText, currentPosition, key, maxFillInCapacity);
-         }
+      if (isWhiteSpaceBeforeCurrentOffset(originalText, currentPosition, maxFillInCapacity))
+      {
+         updateCurrentContent(originalText, originalTextLengthTrimmed);
+         return true;
+      }
+
+      if (shouldPropagateAfterInsertion(originalText, originalTextLengthTrimmed, maxFillInCapacity))
+      {
+         return handlePropagationAfterInsertion(originalText, currentPosition, key);
+      }
+
+      if (canInsertWithoutPropagation(currentPosition, originalTextLengthTrimmed, maxFillInCapacity))
+      {
+         return handleSimpleInsert(originalText, currentPosition, key, maxFillInCapacity);
       }
 
       return true;
@@ -4080,14 +4064,14 @@
       // Character is about to be inserted
       String originalText = getText();
       int currentPosition = getCursorOffset();
-      int originalTextLengthTrimmed = StringHelper.safeTrimTrailing(originalText).length();
       int maxFillInCapacity = config.appFormat.getScreenWidth();
 
       if (currentPosition < maxFillInCapacity)
       {
          return handleSimpleInsert(originalText, currentPosition, key, maxFillInCapacity);
       }
-      else if(String.valueOf((char) key).equals(" ") &&
+      
+      if(String.valueOf((char) key).equals(" ") &&
             !isLastInGroup())
       {
          // Move the focus to the next fill-in.

