File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -583,6 +583,15 @@ def ask_confirmation(self, q):
583583 def do_paste (self , widget ):
584584 self .pastebin ()
585585
586+ def do_partial_paste (self , widget ):
587+ bounds = self .text_buffer .get_selection_bounds ()
588+ if bounds == ():
589+ # FIXME show a nice status bar message
590+ pass
591+ else :
592+ self .pastebin (self .text_buffer .get_text (bounds [0 ], bounds [1 ]))
593+
594+
586595 def write (self , s ):
587596 """For overriding stdout defaults"""
588597 if '\x04 ' in s :
@@ -741,6 +750,10 @@ def main(args=None):
741750 pastebin = gtk .MenuItem ("Pastebin" )
742751 pastebin .connect ("activate" , repl_widget .do_paste )
743752 filemenu .append (pastebin )
753+
754+ pastebin_partial = gtk .MenuItem ("Pastebin selection" )
755+ pastebin_partial .connect ("activate" , repl_widget .do_partial_paste )
756+ filemenu .append (pastebin_partial )
744757
745758 exit = gtk .MenuItem ("Exit" )
746759 exit .connect ("activate" , gtk .main_quit )
You can’t perform that action at this time.
0 commit comments