jaypei / emacs-neotree

A emacs tree plugin like NerdTree for Vim.
GNU General Public License v3.0
1.56k stars 147 forks source link

Change neo-hide-cursor bool to a selection for 3+ options #349

Open DivineDominion opened 2 years ago

DivineDominion commented 2 years ago

Hiding the cursor #233 was implemented in #276

A side-effect of hiding the cursor is that hl-line-mode is then enabled automatically.

I wonder if changing the customization option from a boolean to a selection would make sense, with e.g.: neo-selection-indicator set to one of 'cursor, 'hl-line, 'none (or nil).

I could make the change, but want to discuss this first.

What do y'all think?

DivineDominion commented 2 years ago

Sketched in code:

(defcustom neo-selection-indicator 'cursor
  :type '(choice (const :tag "Cursor" 'cursor)
                 (const :tag "None" nil)
                 (const :tag "Highlight Line" 'hl-line)))

Instead of constant values set to symbols, might also add a function that's executable, but not sure if I personally prefer that. Interpreting the symbols would be fine with me.

Abdisalan commented 1 year ago

Curious, how do you keep track of what line you're on if there's no cursor or highlight?

DivineDominion commented 1 year ago

@Abdisalan I don't; this is rather preserving the current customization options (as I understand them). Switching between cursor and line highlight without a 3rd option sounds sensible to me, though.

Abdisalan commented 1 year ago

@DivineDominion I agree, we shouldn't be forced to use hl-line if we don't want to. If you put a PR for this change I'll approve it