Mercurial > vim
view runtime/ftplugin/clojure.vim @ 34596:5a8340e044f4 v9.1.0190
patch 9.1.0190: complete_info() returns wrong order of items
Commit: https://github.com/vim/vim/commit/8950bf7f8b85c1287d4e696965d88091fcc60594
Author: Girish Palya <girishji@gmail.com>
Date: Wed Mar 20 20:07:29 2024 +0100
patch 9.1.0190: complete_info() returns wrong order of items
Problem: complete_info() returns wrong order of items
(after v9.0.2018)
Solution: Revert Patch v9.0.2018
(Girish Palya)
bug fix: complete_info() gives wrong results
1) complete_info() reverses list of items during <c-p>
2) 'selected' item index is wrong during <c-p>
3) number of items returnd can be wrong
Solution:
- Decouple 'cp_number' from 'selected' index since they need not be
correlated
- Do not iterate the list backwards
- Add targeted tests
Regression introduced by https://github.com/vim/vim/commit/69fb5afb3bc9da24c2fb0eafb0027ba9c6502fc2
Following are unnecessary commits to patch problems from above:
https://github.com/vim/vim/commit/fef66301665027f1801a18d796f74584666f41ef
https://github.com/vim/vim/commit/daef8c74375141974d61b85199b383017644978c
All the tests from above commits are retained though.
fixes: #14204
closes: #14241
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 20 Mar 2024 20:15:03 +0100 |
parents | 8ae680be2a51 |
children |
line wrap: on
line source
" Vim filetype plugin file " Language: Clojure " Maintainer: Alex Vear <alex@vear.uk> " Former Maintainers: Sung Pae <self@sungpae.com> " Meikel Brandmeyer <mb@kotka.de> " URL: https://github.com/clojure-vim/clojure.vim " License: Vim (see :h license) " Last Change: 2022-03-24 " 2024 Jan 14 by Vim Project (browsefilter) if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim let b:undo_ftplugin = 'setlocal iskeyword< define< formatoptions< comments< commentstring< lispwords<' setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,:,$,%,&,\| " There will be false positives, but this is better than missing the whole set " of user-defined def* definitions. setlocal define=\\v[(/]def(ault)@!\\S* " Remove 't' from 'formatoptions' to avoid auto-wrapping code. setlocal formatoptions-=t " Lisp comments are routinely nested (e.g. ;;; SECTION HEADING) setlocal comments=n:; setlocal commentstring=;\ %s " Specially indented symbols from clojure.core and clojure.test. " " Clojure symbols are indented in the defn style when they: " " * Define vars and anonymous functions " * Create new lexical scopes or scopes with altered environments " * Create conditional branches from a predicate function or value " " The arglists for these functions are generally in the form of [x & body]; " Functions that accept a flat list of forms do not treat the first argument " specially and hence are not indented specially. " " -*- LISPWORDS -*- " Generated from https://github.com/clojure-vim/clojure.vim/blob/fd280e33e84c88e97860930557dba3ff80b1a82d/clj/src/vim_clojure_static/generate.clj setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test " Provide insert mode completions for special forms and clojure.core. As " 'omnifunc' is set by popular Clojure REPL client plugins, we also set " 'completefunc' so that the user has some form of completion available when " 'omnifunc' is set and no REPL connection exists. for s:setting in ['omnifunc', 'completefunc'] if exists('&' . s:setting) && empty(eval('&' . s:setting)) execute 'setlocal ' . s:setting . '=clojurecomplete#Complete' let b:undo_ftplugin .= ' | setlocal ' . s:setting . '<' endif endfor " Skip brackets in ignored syntax regions when using the % command if exists('loaded_matchit') let b:match_words = &matchpairs let b:match_skip = 's:comment\|string\|regex\|character' let b:undo_ftplugin .= ' | unlet! b:match_words b:match_skip' endif " Filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Clojure Files\t*.clj;*.cljc;*.cljs;*.cljx\n" . \ "EDN Files\t*.edn\n" . \ "Java Files\t*.java\n" if has("win32") let b:browsefilter .= "All Files (*.*)\t*\n" else let b:browsefilter .= "All Files (*)\t*\n" endif let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif let &cpo = s:cpo_save unlet! s:cpo_save s:setting s:dir " vim:sts=8:sw=8:ts=8:noet