summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pylyricsrecord.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pylyricsrecord.py b/pylyricsrecord.py
index 1d330ef..e308198 100644
--- a/pylyricsrecord.py
+++ b/pylyricsrecord.py
@@ -52,12 +52,14 @@ class LyricsEditor (gtk.TextView):
def select_next (self):
def next_pos ():
+ if self.current == len (self.text) + 1:
+ return -1
space_pos = self.text.find (" ", self.current)
tab_pos = self.text.find ("\t", self.current)
newline_pos = self.text.find ("\n", self.current)
pos = [space_pos, tab_pos, newline_pos]
if max (pos) == -1:
- return -1
+ return len (self.text)
return min ([p for p in pos if p != -1])
pos = next_pos ()
while pos == self.current:
@@ -151,6 +153,8 @@ class PyLyricsRecord (object):
def mark (self, widget):
position, format = self.player.query_position (gst.FORMAT_TIME)
self.editor.mark (position / (1000 * 1000))
+ if not self.editor.can_mark:
+ self.mark_button.set_sensitive (False)
def lock_lyrics (self, widget):
if not widget.get_property ("sensitive"):