abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.31k stars 338 forks source link

Strange index selected after ivy-partial-or-done #2918

Closed vitek closed 3 years ago

vitek commented 3 years ago

Steps to reproduce:

  1. I'm using emacs28, ivy, counsel + flx
  2. Start tetris and kill the buffer or (require 'tetris)
  3. counsel-M-x ^tet
  4. 6th item is chosen

image

  1. Press TAB. 6th item is still chosen which seems strange to me

image

Locally I fixed this with (setq ivy--recompute-index-inhibit t)

It looks like ivy tries to preserve index after completion. Is that expected behaviour?

basil-conto commented 3 years ago

I'm having a hard time following the recipe, so I can't reproduce the issue. Here's what I'm doing:

  1. cd "$(mktemp -d)"

  2. HOME="$PWD" XDG_CONFIG_HOME="$PWD/.config" emacs -Q

  3. (progn
     (require 'package)
     (push '("melpa" . "https://melpa.org/packages/")
           package-archives)
     (package-refresh-contents)
     (mapc #'package-install '(counsel flx))
     (setq ivy-re-builders-alist '((t . ivy--regex-fuzzy)))
     (ivy-mode)
     (counsel-mode)
     (require 'tetris))
  4. C-x C-e

  5. M-x tet

    2021-09-26-224825_956x525_scrot

  6. TAB

    2021-09-26-224835_956x525_scrot

Using https://elpa.gnu.org/devel/ instead of https://elpa.gnu.org/packages/ for the Ivy and Counsel packages (IOW, installing their latest development versions rather than releases) makes no difference either.

Here are my Emacs configuration details as collected by M-x report-emacs-bug RET:

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-09-26 built on tia
Repository revision: 4cc43449432427817400bad12e7ef722e6591a21
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-Og -ggdb' --config-cache
 --prefix=/home/blc/.local --enable-checking=structs
 --with-x-toolkit=lucid --with-file-notification=yes --with-x'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_IE.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  counsel-mode: t
  ivy-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail thingatpt tetris gamegrid
counsel xref project xdg advice swiper cl-extra help-mode ivy warnings
edmacro kmacro delsel ivy-faces ivy-overlay colir color compile comint
ansi-color ring info find-func easy-mmode autoload radix-tree lisp-mnt
tar-mode arc-mode archive-mode cus-edit pp cus-start cus-load wid-edit
finder-inf mm-archive message dired dired-loaddefs rfc822 mml mml-sec
epa derived gnus-util rmail rmail-loaddefs text-property-search
time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode
mail-utils gnutls network-stream url-http mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm rmc puny url-cache
url-auth epg rfc6068 epg-config package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty make-network-process emacs)

What am I missing? Thanks.

vitek commented 3 years ago

I'm sorry to bother you. Suddenly it's gone. Can't reproduce it right now either. Perhaps I've updated something emacs itself or packages. I'll come back with more details if it happens again.

basil-conto commented 3 years ago

No bother, thanks for confirming.