Skip to content

Make swap-quote-keys better #61

@Julian

Description

@Julian

For some reason I need two ^Qs, and it doesn't work with multi-line editing.

An alternate version like:

  local c LBUFFER=$PREBUFFER$LBUFFER

  for (( c = $#LBUFFER; c > 0; c-- )); do
    if [[ $LBUFFER[c] == \' ]]; then
      LBUFFER[c]=\"
      break
    elif [[ $LBUFFER[c] == \" ]]; then
      LBUFFER[c]=\'
      break
    fi
  done

  print -rz -- $LBUFFER$RBUFFER
  zle send-break

would, but should change that so that it only uses that way if it's multiline, otherwise with single-line input, the send-break causes duplicate lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions