summaryrefslogtreecommitdiff
path: root/lib/reline/windows.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/reline/windows.rb')
-rw-r--r--lib/reline/windows.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb
index 2a406e39d3..b09290bcf3 100644
--- a/lib/reline/windows.rb
+++ b/lib/reline/windows.rb
@@ -199,6 +199,20 @@ class Reline::Windows
@@output_buf.unshift(c)
end
+ def self.in_pasting?
+ not self.empty_buffer?
+ end
+
+ def self.empty_buffer?
+ if not @@input_buf.empty?
+ false
+ elsif @@kbhit.call == 0
+ true
+ else
+ false
+ end
+ end
+
def self.get_screen_size
csbi = 0.chr * 22
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)