SparkupNext() doesn't account for non-standard movement keys #98

Closed
ghost opened this Issue Feb 27, 2014 · 2 comments

Projects

None yet

1 participant

@ghost

On line 118, execute 'normal l' screws up because I use a dvorak keyboard layout and remapped my movement to dhtn. Changing this to normal n corrected the problem, but that won't work for everyone since keybindings vary across the board

Here's my stab at refactoring it to work independently of keybindings:

function! s:SparkupNext()
    " 1: empty tag, 2: empty attribute, 3: empty line
    let n = search('><\/\|\(""\)\|\(^\s*$\)', 'Wp')
    if n == 3
        startinsert!
    else
        let p = getpos(".")
        let p[2] = p[2] + 1
        call setpos(".", p)
        startinsert
    endif
endfunction

If I knew how to generate a patch or figure out pull requests, I'd offer it; I hope this is satisfactory. This plugin is great, btw! I can't wait to integrate it with my workflow. Thanks for reading.

EDIT: corrected execute setpos to call setpos.

@ghost

Looks like the accepted Pull Request from my fork didn't close this issue, so I'll close it myself. Thanks for accepting the code!

@ghost ghost closed this Oct 21, 2014
@faceleg
Collaborator

👍

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment