Open AkashGanesan opened 6 years ago
Can you fill the Environment section? You are probably using evil.
I've updated the environment section. Weirdly, sp-describe-system doesn't do anything.
And I'm not using evil but I do have it installed. I disabled it after startup (haven't removed it from my config so starts with evil active and I disable it after startup).
The command should ask you for information if it cant detect it and then put the thing into your clipboard so you can paste it here.
I guess I should pop a buffer instead so that people see the result, might be better UX :+1:
Are you putting the cursor at the beginning or end of endfunction
. Right now it will only work if the point is after the last n
. If you want it to work in the beginning also you can set sp-show-pair-from-inside
to t
. This will however change it globally, it's not possible to change itonly for a certain pair. I was thinking about adding a pair permission for highlighting but it was never implemented.
I don't think there's any way to make it highlight if the cursor is in the middle of the delimiter.
Or a line in the command buffer saying the info has be copied to the clipboard. That should be fine as well.
Also, I tried it with the cursor at the end but it is not highlighting. Even after setting sp-show-pair-from-inside, it still doesn't highlight when I try it on the end or the starting of endfunction.
Is there a character limit on how long this can be? I vaguely remember a 10 character limit somewhere but can't find the documentation for it anywhere.
(defconst sp-max-pair-length 10 "Maximum length of an opening or closing delimiter."
I found this in the Smartparens.el. Is this limit applied since endfunction is longer than 10 chars long?
UPDATE: So, I did the following
(defconst sp-max-pair-length 15)
With this, it detects it correctly. I also tired to see if this is the issue and changed it to 5 and it doesn't detect it.
So, this variable is the one to change. Al least in case of verilog mode.
Does changing this limit break anything else? Or do I have to change certain other values dependent on this?
Oh, interesting. That would take me quite some time to figure out :D
The constant only serves a performance reason because backward regexp search is really slow in Emacs. Changing it to 15 or 20 shouldn't make much difference though.
I should probably just get rid of it and calculate the length based on the longest pair. The reason being that we create regexpes and sometimes a run-away search might happen so this caps that.
Expected behavior
When the cursor is on function in the below, it highlights both the brackets defined.
function
..
endfunction
However, when I place my cursor on the endfunction, it doesn't highltight both the words.
Actual behavior
Cursor on endfunction should highlight 'function' as well.
Steps to reproduce the problem
Open a verilog mode file (.sv, .v, .svh); I assume it will also work in any other mode.
(sp-local-pair 'verilog-mode "function" "endfunction") M-x show-smartparens-mode
Backtraces if necessary (
M-x toggle-debug-on-error
)Environment & version information
From sp-describe-system:
smartparens
version: 20180604.232Active
major-mode
:verilog-mode
Smartparens strict mode: nil
Emacs version (
M-x emacs-version
): GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2017-03-27Starterkit/Distribution: Vanilla
OS: gnu/linux
Active major-mode: verilog-mode
Emacs version (
M-x emacs-version
): GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2017-03-27Spacemacs/Evil/Other starterkit (specify which)/Vanilla:Vanilla
OS: CentOS 6.6
And no, I'm not using evil.