Skip to content

Commit 2586132

Browse files
committed
Merge branch 'dev'
2 parents cce78ca + 9bf9635 commit 2586132

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ Changelog
163163

164164
* Added items highlighting
165165

166+
#### 0.5.1
167+
168+
* Fixed the annoying noise when navigating over items in default mode
169+
* Fixed the cursor position after the item is toggled
170+
166171
Credits
167172
-------
168173

doc/vim-todo-lists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*vim-todo-lists.txt* Version 0.4.0
1+
*vim-todo-lists.txt* Version 0.5.1
22
*vim-todo-lists*
33

44
Plugin for TODO lists management.
@@ -196,6 +196,11 @@ SOFTWARE.
196196

197197
* Added items highlighting
198198

199+
0.5.1
200+
201+
* Fixed the annoying noise when navigating over items in default mode
202+
* Fixed the cursor position after the item is toggled
203+
199204
==============================================================================
200205
8. Credits *VimTodoListsCredits*
201206

plugin/vim-todo-lists.vim

+11-6
Original file line numberDiff line numberDiff line change
@@ -217,36 +217,34 @@ function! VimTodoListsCreateNewItemAbove()
217217
endfunction
218218

219219

220-
" Creates e new item below the current line
220+
" Creates a new item below the current line
221221
function! VimTodoListsCreateNewItemBelow()
222222
normal! o [ ]
223223
startinsert!
224224
endfunction
225225

226226

227-
" Creates e new item in the current line
227+
" Creates a new item in the current line
228228
function! VimTodoListsCreateNewItem()
229229
normal! 0i [ ]
230230
startinsert!
231231
endfunction
232232

233233

234-
" Moves te cursor to the next item
234+
" Moves the cursor to the next item
235235
function! VimTodoListsGoToNextItem()
236236
normal! $
237237
silent! exec '/^\s*\[.\]'
238238
silent! exec 'noh'
239-
normal! f[
240239
normal! l
241240
endfunction
242241

243242

244-
" Moves te cursor to the previous item
243+
" Moves the cursor to the previous item
245244
function! VimTodoListsGoToPreviousItem()
246245
normal! 0
247246
silent! exec '?^\s*\[.\]'
248247
silent! exec 'noh'
249-
normal! f[
250248
normal! l
251249
endfunction
252250

@@ -255,12 +253,19 @@ endfunction
255253
function! VimTodoListsToggleItem()
256254
let l:line = getline('.')
257255

256+
" Store current cursor position
257+
let l:cursor_pos = getcurpos()
258+
258259
if VimTodoListsItemIsNotDone(l:line) == 1
259260
call VimTodoListsForEachChild(line('.'), 'VimTodoListsSetItemDone')
260261
elseif VimTodoListsItemIsDone(l:line) == 1
261262
call VimTodoListsForEachChild(line('.'), 'VimTodoListsSetItemNotDone')
262263
endif
263264

265+
" Restore the current position
266+
" Using the {curswant} value to set the proper column
267+
call cursor(l:cursor_pos[1], l:cursor_pos[4])
268+
264269
call VimTodoListsUpdateParent(line('.'))
265270
endfunction
266271

0 commit comments

Comments
 (0)