|
4 | 4 | program_name = 'EasyABC ' + program_version
|
5 | 5 |
|
6 | 6 | # Copyright (C) 2011-2014 Nils Liberg (mail: kotorinl at yahoo.co.uk)
|
7 |
| -# Copyright (C) 2015-2021 Seymour Shlien (mail: [email protected]), Jan Wybren de Jong (jw_de_jong at yahoo dot com) |
| 7 | +# Copyright (C) 2015-2024 Seymour Shlien (mail: [email protected]), Jan Wybren de Jong (jw_de_jong at yahoo dot com) |
8 | 8 | #
|
9 | 9 | # This program is free software: you can redistribute it and/or modify
|
10 | 10 | # it under the terms of the GNU Lesser General Public License as published by
|
@@ -6799,10 +6799,10 @@ def OnCharEvent(self, evt):
|
6799 | 6799 | if is_inside_field:
|
6800 | 6800 | evt.Skip()
|
6801 | 6801 | return
|
6802 |
| - |
| 6802 | + is_inside_chord = self.position_is_in_chord(cur_pos) |
6803 | 6803 | at_end_of_line = not line[caret:].strip(' \r\n|:][')
|
6804 | 6804 | use_typing_assist = self.mni_TA_active.IsChecked()
|
6805 |
| - if use_typing_assist and in_music_code: |
| 6805 | + if use_typing_assist and in_music_code and not is_inside_chord: |
6806 | 6806 | if c == '-' and no_selection:
|
6807 | 6807 | self.AddTextWithUndo('- ')
|
6808 | 6808 | return
|
@@ -7160,7 +7160,11 @@ def replace_selection(self, text):
|
7160 | 7160 | def position_is_music_code(self, position):
|
7161 | 7161 | style_at = self.editor.GetStyleAt
|
7162 | 7162 | return style_at(position) == self.styler.STYLE_DEFAULT \
|
7163 |
| - and style_at(position-1) not in (self.styler.STYLE_EMBEDDED_FIELD_VALUE, self.styler.STYLE_EMBEDDED_FIELD) |
| 7163 | + and style_at(position-1) not in (self.styler.STYLE_EMBEDDED_FIELD_VALUE, self.styler.STYLE_EMBEDDED_FIELD, self.styler.STYLE_COMMENT_NORMAL) |
| 7164 | + |
| 7165 | + def position_is_in_chord(self, position): |
| 7166 | + style_at = self.editor.GetStyleAt |
| 7167 | + return style_at(position-1) == self.styler.STYLE_CHORD |
7164 | 7168 |
|
7165 | 7169 | def OnKeyDownEvent(self, evt):
|
7166 | 7170 | # temporary work-around for what seems to be a scintilla bug on Mac:
|
|
0 commit comments