select_unread_item (Raggle::Interfaces::NcursesInterface)

    # File raggle, line 3756
          def NcursesInterface::select_unread_item(direction)
            item_win = $wins[NcursesInterface::get_win_id('item')]
            feed_win = $wins[NcursesInterface::get_win_id('feed')]
            feed = $a_feed; item = $a_item  # start at current feed/item
            max = $config['feeds'].get(feed)['items'].size

            begin  # until we get back to original feed
              begin  # until we hit a window border
                cur_item = $config['feeds'].get(feed)['items'][item]
                # activate and return if unread visible item found
                if cur_item and cur_item['read?'] == false and cur_item['visible'] != false
                  NcursesInterface::select_feed(feed) unless feed == $a_feed
                  NcursesInterface::select_id(item)
                  feed_win.active_item = feed
                  item_win.activate(item)
                  return 0
                end
                item += direction
              end until item < 0 or item >= max  # switch feeds to find prev/next
              feed = (feed + direction) % $config['feeds'].size
              max = $config['feeds'].get(feed)['items'].size
              (direction > 0) ? item = 0 : item = max - 1  # set sensible search start
            end until feed == $a_feed
          end