Clone in a terminal:
Commit f010d35
Johan Mattsson - 2015-03-24T14:35:40+00:00
f010d356a84c778534ca3fc224775b7d52585adajohan.mattsson.m@gmail.com

Update ligature editing

Changed files (1)

Diff

diff --git a/libbirdfont/LigatureList.vala b/libbirdfont/LigatureList.valaindex f749d63..75c7a59 100644--- a/libbirdfont/LigatureList.vala+++ b/libbirdfont/LigatureList.vala@@ -45,7 +45,10 @@ public class LigatureList : Table { 		Font font = BirdFont.get_current_font (); 		Ligatures ligatures = font.get_ligatures (); 		int i;+		int ncontextual; 		+		ncontextual = ligatures.contextual_ligatures.size;+ 		if (row.get_index () == NEW_LIGATURE && column == 0) { 			add_ligature (t_("character sequence"), t_("ligature")); 			TabContent.hide_text_input ();@@ -54,22 +57,8 @@ public class LigatureList : Table { 				add_contextual_ligature (t_("substitution"), t_("beginning"), t_("middle"), t_("end")); 				TabContent.hide_text_input (); 			}-		} else if (row.get_index () < ligatures.count ()) {-			if (ligatures.count () != 0) {-				if (delete_button) {-					return_if_fail (0 <= row.get_index () < ligatures.count ());-					ligatures.remove_at (row.get_index ());-					TabContent.hide_text_input ();-				} else if (column == 0) {-					return_if_fail (0 <= row.get_index () < ligatures.count ());-					ligatures.set_ligature (row.get_index ());-				} else if (column == 2) {-					return_if_fail (0 <= row.get_index () < ligatures.count ());-					ligatures.set_substitution (row.get_index ());-				}-			}-		} else {-			i = row.get_index () - ligatures.count ();+		} else if (row.get_index () < ncontextual) {+			i = row.get_index (); 			if (i < ligatures.count_contextual_ligatures ()) { 				return_if_fail (0 <= i < ligatures.count_contextual_ligatures ()); 				if (delete_button) {@@ -85,7 +74,23 @@ public class LigatureList : Table { 					ligatures.set_end (i); 				}  			}-		}+		} else if (row.get_index () >= ncontextual) {+			i = row.get_index () - ncontextual;+			+			if (ligatures.count () != 0) {+				if (delete_button) {+					return_if_fail (0 <= i < ligatures.count ());+					ligatures.remove_at (i);+					TabContent.hide_text_input ();+				} else if (column == 0) {+					return_if_fail (0 <= i < ligatures.count ());+					ligatures.set_ligature (i);+				} else if (column == 2) {+					return_if_fail (0 <= i < ligatures.count ());+					ligatures.set_substitution (i);+				}+			}+		}  			 		update_rows (); 		update_scrollbar ();

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112