Templates/TemplateViewer.py

changeset 3539
0c2dc1446ebf
parent 3484
645c12de6b0c
child 3621
15f23ed3f216
equal deleted inserted replaced
3538:33a75660df08 3539:0c2dc1446ebf
739 if "i_n_s_e_r_t_i_o_n" in txt: 739 if "i_n_s_e_r_t_i_o_n" in txt:
740 lines = 1 740 lines = 1
741 for aline in txt.splitlines(): 741 for aline in txt.splitlines():
742 count = aline.find("i_n_s_e_r_t_i_o_n") 742 count = aline.find("i_n_s_e_r_t_i_o_n")
743 if count >= 0: 743 if count >= 0:
744 txt = txt.replace("i_n_s_e_r_t_i_o_n", "") 744 txt = txt.replace("i_n_s_e_r_t_i_o_n", "")
745 if lines == 1: 745 if lines == 1:
746 count += index 746 count += index
747 else: 747 else:
748 if len(indent) > 0: 748 if len(indent) > 0:
749 count += len(indent) 749 count += len(indent)
756 setselect = True 756 setselect = True
757 linea = 1 757 linea = 1
758 for aline in txt.splitlines(): 758 for aline in txt.splitlines():
759 posa = aline.find("s_e_l_e_c_t_s_t_a_r_t") 759 posa = aline.find("s_e_l_e_c_t_s_t_a_r_t")
760 if posa >= 0: 760 if posa >= 0:
761 txt = txt.replace("s_e_l_e_c_t_s_t_a_r_t", "") 761 txt = txt.replace("s_e_l_e_c_t_s_t_a_r_t", "")
762 break 762 break
763 else: 763 else:
764 linea += 1 764 linea += 1
765 lineb = 1 765 lineb = 1
766 for aline in txt.splitlines(): 766 for aline in txt.splitlines():
767 posb = aline.find("s_e_l_e_c_t_e_n_d") 767 posb = aline.find("s_e_l_e_c_t_e_n_d")
768 if posb >= 0: 768 if posb >= 0:
769 txt = txt.replace("s_e_l_e_c_t_e_n_d", "") 769 txt = txt.replace("s_e_l_e_c_t_e_n_d", "")
770 break 770 break
771 else: 771 else:
772 lineb += 1 772 lineb += 1
773 773
774 editor.insert(txt) 774 editor.insert(txt)

eric ide

mercurial