diff options
| author | Martin White <[email protected]> | 2020-12-16 01:27:10 +0000 |
|---|---|---|
| committer | Amir Rajan <[email protected]> | 2021-01-05 22:42:38 -0600 |
| commit | 169b8c90cc49457922db82d8716b7eb82bbbe2e4 (patch) | |
| tree | 1b3f459e2c829991292caf050de043e316e3bf13 /dragon/console_prompt.rb | |
| parent | 0931049a82b17ebbdba547ac546eda6961f83845 (diff) | |
| download | dragonruby-game-toolkit-contrib-169b8c90cc49457922db82d8716b7eb82bbbe2e4.tar.gz dragonruby-game-toolkit-contrib-169b8c90cc49457922db82d8716b7eb82bbbe2e4.zip | |
Added forward delete support to console prompt
Diffstat (limited to 'dragon/console_prompt.rb')
| -rw-r--r-- | dragon/console_prompt.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dragon/console_prompt.rb b/dragon/console_prompt.rb index 9d169ee..e8c2820 100644 --- a/dragon/console_prompt.rb +++ b/dragon/console_prompt.rb @@ -51,6 +51,13 @@ module GTK reset_autocomplete end + def delete + return if current_input_str.length.zero? || @cursor_position == current_input_str.length + + @cursor_position += 1 + backspace + end + def move_cursor_left @cursor_position -= 1 if @cursor_position > 0 update_cursor_position_px |
