all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrew Pennebaker <andrew.pennebaker@gmail.com>
To: Emacs Help <help-gnu-emacs@gnu.org>
Subject: hideshow bug with json-mode
Date: Wed, 6 May 2015 12:37:57 -0500	[thread overview]
Message-ID: <CAHXt_SW31uNih-x1wdxBLCVeHUm3VMNcf=TDOR44Pdpf+pQ4jw@mail.gmail.com> (raw)

If I don't carefully position my cursor right on the opening curly brace,
then hideshow toggles the parent block instead of the current line's block.

package.json:

{
  "name": "dotfiles",
  "repository": {
    "type": "git"
  }
}

Steps to reproduce:

M-g g 3
M-x hs-toggle-hiding RET

Expected:

{
  "name": "dotfiles",
  "repository": { ... }
}

Observed:

{ ... }

This problem only happens in certain major modes; python-mode with
hs-minor-mode works as expected, whereas json-mode with hs-minor-mode
features this problem.

Any suggestions for configuration to work around this problem? I considered
adding advice to automatically go to the end of line before toggling, but
this doesn't work when re-showing the block, as the cursor needs to be on
the brace ({), but before the ellipsis (...).

-- 
Cheers,
Andrew


             reply	other threads:[~2015-05-06 17:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 17:37 Andrew Pennebaker [this message]
2015-05-06 20:45 ` hideshow bug with json-mode Robert Thorpe
2015-05-07  2:35   ` Andrew Pennebaker
2015-05-07  2:37     ` Andrew Pennebaker
2015-05-07 13:20 ` Michael Heerdegen
2015-05-07 14:02   ` Andrew Pennebaker
2015-05-07 20:50     ` Robert Thorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHXt_SW31uNih-x1wdxBLCVeHUm3VMNcf=TDOR44Pdpf+pQ4jw@mail.gmail.com' \
    --to=andrew.pennebaker@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.