# Copyright (c) 1993 by Sanjay Ghemawat
###############################################################################
# Fix bindings to more reasonable behavior

proc fix_bindings {} {
    bind Text <Control-d> {
	if [catch {%W delete sel.first sel.last}] {
	    %W delete insert
	}
	%W yview -pickplace insert
    }

    bind Text <Control-v> {
	if ![catch {%W insert insert [selection get]}] {
	    %W yview -pickplace insert
	}
    }

    bind Text <Control-h> {
	tk_textBackspace %W
	%W yview -pickplace insert
    }

    bind Entry <Control-d> {
	if [catch {%W delete sel.first sel.last}] {
	    %W delete insert
	}
	tk_entrySeeCaret %W
    }

    bind Entry <Control-v> {
	if ![catch {%W insert insert [selection get]}] {
	    tk_entrySeeCaret %W
	}
    }

    bind Entry <Control-h> {
	tk_entryBackspace %W
	tk_entrySeeCaret %W
    }
}
