Revert commits adb68a1..7df86bb ("improved" X windows paste handling).
This commit is contained in:
parent
adb68a14c5
commit
c699727bf2
8 changed files with 18 additions and 39 deletions
|
@ -9,7 +9,6 @@ Diakonos Changelog
|
|||
- Fixed some issues with installer.
|
||||
- Changed delete_to_and_from to always assume given character is the left side character when matching pairs.
|
||||
- Fixed a line number display bug.
|
||||
- Improved handling of external (X windows) pastes.
|
||||
- Numerous internal refactorings and reorganizations.
|
||||
- Accepted patches from Decklin Foster.
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ module Diakonos
|
|||
end
|
||||
@current_buffer_state = 0
|
||||
|
||||
@pen_down = true
|
||||
@top_line = 0
|
||||
@left_column = 0
|
||||
@desired_column = 0
|
||||
|
|
|
@ -62,17 +62,15 @@ module Diakonos
|
|||
remove_selection( DONT_DISPLAY )
|
||||
removed = true
|
||||
end
|
||||
if do_display
|
||||
if removed || selecting? || view_changed
|
||||
display
|
||||
else
|
||||
@diakonos.display_mutex.synchronize do
|
||||
@win_main.setpos( @last_screen_y, @last_screen_x )
|
||||
end
|
||||
if removed or ( do_display and ( selecting? or view_changed ) )
|
||||
display
|
||||
else
|
||||
@diakonos.display_mutex.synchronize do
|
||||
@win_main.setpos( @last_screen_y, @last_screen_x )
|
||||
end
|
||||
@diakonos.update_status_line
|
||||
@diakonos.update_context_line
|
||||
end
|
||||
@diakonos.update_status_line
|
||||
@diakonos.update_context_line
|
||||
|
||||
@diakonos.remember_buffer self
|
||||
end
|
||||
|
|
|
@ -160,7 +160,7 @@ module Diakonos
|
|||
end
|
||||
|
||||
def print_string( string, formatting = ( @token_formats[ @continued_format_class ] or @default_formatting ) )
|
||||
return if ! @pen_down
|
||||
return if not @pen_down
|
||||
return if string.nil?
|
||||
|
||||
@win_main.attrset formatting
|
||||
|
@ -245,7 +245,7 @@ module Diakonos
|
|||
end
|
||||
|
||||
def print_padding_from( col )
|
||||
return if ! @pen_down
|
||||
return if not @pen_down
|
||||
|
||||
if col < @left_column
|
||||
remainder = Curses::cols
|
||||
|
@ -270,6 +270,8 @@ module Diakonos
|
|||
|
||||
@continued_format_class = nil
|
||||
|
||||
@pen_down = true
|
||||
|
||||
# First, we have to "draw" off-screen, in order to check for opening of
|
||||
# multi-line highlights.
|
||||
|
||||
|
@ -284,12 +286,11 @@ module Diakonos
|
|||
open_index, open_token_class, open_match_text = find_opening_match( line )
|
||||
|
||||
if open_token_class
|
||||
original_pen_state = @pen_down
|
||||
@pen_down = false
|
||||
@lines[ index...@top_line ].each do |line|
|
||||
print_line line
|
||||
end
|
||||
@pen_down = original_pen_state
|
||||
@pen_down = true
|
||||
|
||||
break
|
||||
end
|
||||
|
|
|
@ -210,7 +210,6 @@ module Diakonos
|
|||
|
||||
def update_status_line
|
||||
return if @testing
|
||||
return if ! @do_display
|
||||
|
||||
str = build_status_line
|
||||
if str.length > Curses::cols
|
||||
|
|
|
@ -6,7 +6,7 @@ module Diakonos
|
|||
@current_buffer.cursor_to(
|
||||
@current_buffer.last_row + 1,
|
||||
@current_buffer.last_col,
|
||||
@do_display,
|
||||
Buffer::DO_DISPLAY,
|
||||
Buffer::STOPPED_TYPING,
|
||||
DONT_ADJUST_ROW
|
||||
)
|
||||
|
@ -17,7 +17,7 @@ module Diakonos
|
|||
@current_buffer.cursor_to(
|
||||
@current_buffer.last_row,
|
||||
@current_buffer.last_col - 1,
|
||||
@do_display,
|
||||
Buffer::DO_DISPLAY,
|
||||
stopped_typing
|
||||
)
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ module Diakonos
|
|||
@current_buffer.cursor_to(
|
||||
@current_buffer.last_row,
|
||||
@current_buffer.last_col + amount,
|
||||
@do_display,
|
||||
Buffer::DO_DISPLAY,
|
||||
stopped_typing
|
||||
)
|
||||
end
|
||||
|
@ -36,14 +36,14 @@ module Diakonos
|
|||
@current_buffer.cursor_to(
|
||||
@current_buffer.last_row - 1,
|
||||
@current_buffer.last_col,
|
||||
@do_display,
|
||||
Buffer::DO_DISPLAY,
|
||||
Buffer::STOPPED_TYPING,
|
||||
DONT_ADJUST_ROW
|
||||
)
|
||||
end
|
||||
|
||||
def cursor_bof
|
||||
@current_buffer.cursor_to( 0, 0, @do_display )
|
||||
@current_buffer.cursor_to( 0, 0, Buffer::DO_DISPLAY )
|
||||
end
|
||||
|
||||
def cursor_bol
|
||||
|
|
|
@ -241,10 +241,7 @@ module Diakonos
|
|||
# context is an array of characters (bytes) which are keystrokes previously
|
||||
# typed (in a chain of keystrokes)
|
||||
def process_keystroke( context = [] )
|
||||
t0 = Time.now
|
||||
ch = @win_main.getch
|
||||
time_taken_to_type = Time.now - t0
|
||||
|
||||
return if ch.nil?
|
||||
c = ch.ord
|
||||
|
||||
|
@ -256,20 +253,6 @@ module Diakonos
|
|||
|
||||
if context.empty?
|
||||
if c > 31 and c < 255 and c != BACKSPACE
|
||||
if time_taken_to_type < 0.001
|
||||
if @pen_thread
|
||||
@pen_thread.terminate
|
||||
end
|
||||
@pen_thread = Thread.new do
|
||||
set_iline '(processing external paste)'
|
||||
@do_display = false
|
||||
sleep 0.1
|
||||
@do_display = true
|
||||
set_iline
|
||||
@current_buffer.display
|
||||
end
|
||||
end
|
||||
|
||||
if @macro_history
|
||||
@macro_history.push "type_character #{c}"
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
module Diakonos
|
||||
VERSION = '0.8.9'
|
||||
LAST_MODIFIED = 'May 19, 2009'
|
||||
LAST_MODIFIED = 'May 14, 2009'
|
||||
end
|
Loading…
Reference in a new issue