reline 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ad1ae315ec2e7717822c6dd2cde886639d5becb7ccf552a64921e12b8452107
4
- data.tar.gz: 191aa399008fb54a8ee3048f5ef96b260d1937fba8203977e15321f45a3fd962
3
+ metadata.gz: 5864c77904d813f20ffdb6963ba8e2297e84c3e71b9c94c2a55528ccf73b47da
4
+ data.tar.gz: c0bf68a1988228c3ad046e3e6658b79d22b59a98792d2c9666ecf92d9bf74a2d
5
5
  SHA512:
6
- metadata.gz: ea45bb1e825b2c17a9d0965a5bfc33e0a42c9c6eb8a29ae3f0500b6de197dc124ba6a99c8e41b6692fa04d3086f7ba1dbb359d9ff0c4a53520246a598719d2f2
7
- data.tar.gz: 6e8780a82c7e59aa9c1f0d6283b7c5f09ea5bb66dda6209aa85cef3bec3ccf1079d4a3cc113b33403e6ee274403f1f0c021f892c871123a255985965b017d798
6
+ metadata.gz: 3ef8bf25d8412ee409a2d5bf13568d50befb5c8a8bbd64b7f82c8649807a42e8c822950d8f76c520ff464ddc91e9c80f1ade09f902f671b5a678631b606ebfd6
7
+ data.tar.gz: 32a2f60967b403860f8efbe92163e0f564e3cff553b700db6a9ddaf8b8a44dd8f30c64db66ff793a95cd7ad2ab8348dd3548d9f2e2ed88ca3f50861d529faec4
@@ -377,6 +377,7 @@ class Reline::LineEditor
377
377
  end
378
378
  new_highest_in_this = calculate_height_by_width(prompt_width + calculate_width(@line.nil? ? '' : @line))
379
379
  # FIXME: end of logical line sometimes breaks
380
+ rendered = false
380
381
  if @add_newline_to_end_of_buffer
381
382
  rerender_added_newline
382
383
  @add_newline_to_end_of_buffer = false
@@ -675,17 +676,13 @@ class Reline::LineEditor
675
676
  Reline::IOGate.move_cursor_column(0)
676
677
  if line.nil?
677
678
  if calculate_width(visual_lines[index - 1], true) == Reline::IOGate.get_screen_size.last
678
- # reaches the end of line
679
- if Reline::IOGate.win?
680
- # A newline is automatically inserted if a character is rendered at
681
- # eol on command prompt.
682
- else
683
- # When the cursor is at the end of the line and erases characters
684
- # after the cursor, some terminals delete the character at the
685
- # cursor position.
686
- move_cursor_down(1)
687
- Reline::IOGate.move_cursor_column(0)
688
- end
679
+ # Reaches the end of line.
680
+ #
681
+ # When the cursor is at the end of the line and erases characters
682
+ # after the cursor, some terminals delete the character at the
683
+ # cursor position.
684
+ move_cursor_down(1)
685
+ Reline::IOGate.move_cursor_column(0)
689
686
  else
690
687
  Reline::IOGate.erase_after_cursor
691
688
  move_cursor_down(1)
@@ -694,10 +691,6 @@ class Reline::LineEditor
694
691
  next
695
692
  end
696
693
  @output.write line
697
- if Reline::IOGate.win? and calculate_width(line, true) == Reline::IOGate.get_screen_size.last
698
- # A newline is automatically inserted if a character is rendered at eol on command prompt.
699
- @rest_height -= 1 if @rest_height > 0
700
- end
701
694
  @output.flush
702
695
  if @first_prompt
703
696
  @first_prompt = false
@@ -1,3 +1,3 @@
1
1
  module Reline
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -258,6 +258,7 @@ class Reline::Windows
258
258
  cursor = csbi[4, 4].unpack('L').first
259
259
  written = 0.chr * 4
260
260
  @@FillConsoleOutputCharacter.call(@@hConsoleHandle, 0x20, get_screen_size.last - cursor_pos.x, cursor, written)
261
+ @@FillConsoleOutputAttribute.call(@@hConsoleHandle, 0, get_screen_size.last - cursor_pos.x, cursor, written)
261
262
  end
262
263
 
263
264
  def self.scroll_down(val)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - aycabta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-11 00:00:00.000000000 Z
11
+ date: 2021-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: io-console