lib/mournmail/message_mode.rb in mournmail-0.1.1 vs lib/mournmail/message_mode.rb in mournmail-0.2.0

- old
+ new

@@ -11,11 +11,12 @@ # See http://nihongo.jp/support/mail_guide/dev_guide.txt URI_REGEXP = /(https?|ftp):\/\/[^  \t\n>)"]*[^]  \t\n>.,:)"]+/ define_syntax :field_name, /^[A-Za-z\-]+: / define_syntax :quotation, /^>.*/ - define_syntax :mime_part, /^\[([0-9.]+) [A-Za-z._\-]+\/[A-Za-z._\-]+.*\]$/ + define_syntax :mime_part, + /^\[(([0-9.]+) [A-Za-z._\-]+\/[A-Za-z._\-]+.*|PGP\/MIME .*)\]$/ define_syntax :link, URI_REGEXP def initialize(buffer) super(buffer) buffer.keymap = MESSAGE_MODE_MAP @@ -51,10 +52,10 @@ @buffer.save_excursion do @buffer.beginning_of_line if @buffer.looking_at?(/\[([0-9.]+) .*\]/) index = match_string(1) indices = index.split(".").map(&:to_i) - Mournmail.current_mail.dig_part(*indices) + @buffer[:mournmail_mail].dig_part(*indices) else nil end end end