File tree 1 file changed +13
-0
lines changed
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):
583
583
def do_paste (self , widget ):
584
584
self .pastebin ()
585
585
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
+
586
595
def write (self , s ):
587
596
"""For overriding stdout defaults"""
588
597
if '\x04 ' in s :
@@ -741,6 +750,10 @@ def main(args=None):
741
750
pastebin = gtk .MenuItem ("Pastebin" )
742
751
pastebin .connect ("activate" , repl_widget .do_paste )
743
752
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 )
744
757
745
758
exit = gtk .MenuItem ("Exit" )
746
759
exit .connect ("activate" , gtk .main_quit )
You can’t perform that action at this time.
0 commit comments