Comments (4)
雖然子模式的切換讓 plugin 用 trigger 去抓就可以了,但這樣會讓 ime.vim 做一次無用的 match。
還是想一下要怎麼定這個介面吧。
from ime.vim.
〔不完全相關〕;;
好像是個可行的 change mode key
在現在的構思中,日文模式的兩個模式是永久的,除非使用者自己切換,不然是不自動切換回來的;但注音的標點符號模式則是暫時的,輸入完一個標點以後就會變回注音。
這個介面必須要能支援兩種方式才行,而且不能限制一個 plugin 只能有一個 submode。兩種方式分別需要兩個方向(ime.vim ←→ plugin)的通知。
- ime.vim → plugin 的方向已經有了(
trigger
),但需要專用的 function- 如果
trigger
沒有結果,ime.vim 會送出 trigger key - 技術上是可以回傳
['']
來 hacking... - 還是訂專用的吧,暫定
submode(switch)
- Plugin 需要再提供
switch
keys
- 如果
- plugin → ime.vim 的,暫定為
ime#icon(pname, icon)
- 雖然 vim 是 single thread,但還是要考慮外部 plugin 的可能性,這裡的
pname
是為了只允許目前的 mode 更改 submode
- 雖然 vim 是 single thread,但還是要考慮外部 plugin 的可能性,這裡的
原本有個想法是要讓 plugin 在 info()
就提供所有的 submode,但這樣太麻煩了;考慮到 user 其實只看得到 icon,就讓 plugin 自己改 icon。
如果在 plugin 處於別的 submode 的時候,user 切換到別的模式了,這時候原本的 plugin submode 應該要被 reset;這個情況用 a:switch == ''
來表示。
from ime.vim.
雖然不能限制一個 plugin 只能有一個 submode,但我想可以對「只有一個 submode 的 plugin」做優化。
ime.vim 也許 可以設定一個 g:ime_switch_submode
之類的變數,如果 plugin 不提供 switch
但又有 submode
的話,就用那個變數來做 mapping。
至於 submode 是暫時還是永久的,就讓 plugin 自己 call ime#icon(pname)
來通知 ime.vim 和 user。
對於只有一個 submode 的 plugin 來說,這樣應該是比較方便的作法,不過還要再想一下。
from ime.vim.
implemented with 87a141b
from ime.vim.
Related Issues (20)
- 更改 trigger 的宣告方式
- E121: Undefined variable: v:completed_item HOT 2
- statusline 被 reset 的問題在 Vim 7.4.52 也發生了 HOT 2
- Change mode selection style option names HOT 1
- Add a meaningful value for plugin handler to indicate "no result, but do not insert that key" HOT 2
- Output .cin file for OpenVanilla to import HOT 1
- User Vader.vim for testing HOT 1
- Lack of mathematical symbols HOT 1
- 同時開啟多個 ime buffer HOT 1
- 將按鍵設定 phase out,以 <Plug> 取代 HOT 2
- 輸出成 cin file 時,假名的打法和官方字根表不一樣 HOT 1
- 將 export to cin 功能抽象化
- [嘸蝦米] 避免拆散成對的方括號 HOT 4
- Interactive menu is sooo lag HOT 2
- Syntax of g:ime_boshiamy_custom_table is too weak HOT 3
- 根據之前輸入的內容決定是否要「不送出」短碼字
- Vader testcase 爆了
- 一定要在 .vimrc 設定 g:ime_plugins 才有作用 HOT 2
- 使用空字串取消預設的keymap HOT 3
- 請問如何輸入中文 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ime.vim.