macvim-dev / macvim-dev/macvim

Using Cmd-C multiple times unexpectedly changes editor contents

Abierto
#1,485 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Vim Script
Estrellas
7.9k
Forks
691
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Steps to reproduce
  1. Open any file in the GUI via gvim <file> or File > Open
  2. Use your mouse to select some text in the editor (i.e. double-click on a word)
  3. Use Cmd-C to copy the highlighted text
  4. Use Cmd-C again - the line your cursor is on gets cleared (sort of like d$ from the start of the line)
  5. Use Cmd-C again - now <D-c> gets appended onto the line once for every time you type Cmd-C
Expected behaviour

I don't expect Cmd-C to alter the editor contents.

I've been using MacVim since 2017, and I've never run into this before, so I think it's a change from previous behavior. However, I can't figure out what is triggering it or why I've only recently started to see it. I apparently have a habit of sometimes copying the same text multiple times, and I've never before had to worry about lines getting deleted or <D-c> getting inserted into the file I'm editing. I still get the behavior I expect if I'm using vim from a MacOS terminal, which is how I realized I have this habit of using Cmd-C multiple times.

I've tested this behavior with multiple install methods: brew install macvim and brew install --cask macvim, plus manual install from GitHub releases using both MacVim.dmg and MacVim_10.9.dmg. I've also tested with multiple versions of MacVim going back to early 2023. I'm able to reproduce this behavior in all versions I've tried.

Since I've never seen this behavior before, I'm wondering whether something about my combination of hardware and OS might be the root cause. Prior to January of 2024, I was running Ventura on an older Intel Macbook, but now I'm running Sonoma on a new M3 Macbook. Maybe something is slightly different about the way the native Mac copy/paste actions are bound?

Behavior is roughly the same with gvim --clean as with my normal vimrc, although I do normally have set mouse="n" configured (a carryover from my Linux vimrc that has been in there since around 2003).

Version of Vim and architecture

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan 04 2024 03:00:35)

Environment

MacOS 14.3.1 (23D60) on a 16" M3 Macbook Pro from Nov 2023

How MacVim was installed

Originally Homebrew (brew install macvim), but behavior persists with other install methods

Logs and stack traces

No response

Vim configuration where issue is reproducable

Occurs with empty vimrc

Issue has been tested with given configuration
  • by running MacVim.app from GUI macOS interface
  • by running vim/gvim/etc installed by MacVim
  • by running other versions of vim (e.g. /usr/bin/vim)
Issue has been tested with no configuration
  • by running mvim --clean (or gvim, supplied by MacVim distribution)
  • by running vim --clean (in terminal, supplied by MacVim distribution)
  • by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)
Other conditions
  • The both Homebrew packages "vim" and "macvim" are installed

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el comportamiento de Cmd-C repetido en la GUI de MacVim usando mvim --clean en macOS y compáralo con terminal vim --clean. Rastrea el manejo nativo de la copia en MacVim y determina por qué las copias posteriores borran o alteran la línea actual; se considera terminado cuando repetir Cmd-C deja sin cambios el contenido del editor.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
macos, vim
Área
desktop
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.