This range checking should be done once before this condition:

```
        value = Math.max(Math.min(value, 10), 1);
        if (Editor.getUseTabChar()) {
            Editor.setTabSize(value);
        } else {
            Editor.setSpaceUnits(value);
        }
```