Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #287 #288

Merged
merged 4 commits into from
May 19, 2019
Merged

Fix #287 #288

merged 4 commits into from
May 19, 2019

Conversation

fox0430
Copy link
Owner

@fox0430 fox0430 commented May 14, 2019

@jrfondren
Copy link
Contributor

Crash remains:

  1. start moe without a file argument
  2. i
  3. 1
  4. <RET>
  5. 2
  6. <ESC>
  7. v
  8. k
  9. d

This leads (by step 6) to a buffer consisting of

1 1
2 2 <CURSOR>

And crashes with:

moe.nim(51)              moe
moe.nim(40)              main
normalmode.nim(538)      normalMode
editorstatus.nim(261)    resize
editorstatus.nim(211)    writeStatusBar
macros.nim(469)          writeStatusBarNormalModeInfo
gapbuffer.nim(87)        []
system.nim(3879)         failedAssertImpl
system.nim(3872)         raiseAssert
system.nim(2918)         sysFatal
Error: unhandled exception: /Users/jfondren/nim/moe/src/moepkg/gapbuffer.nim(87, 11) `0 <= index and index < gapBuffer.size` Gapbuffer: Invalid index. [AssertionError]

Additionally, this PR prevents deletion of empty lines. In a buffer that looks like (with line numbers):

1
2
3
4 <CURSOR>
5
6

You can't enter vkd to delete lines 3 and 4 like you could in previous versions of moe.

@jrfondren
Copy link
Contributor

Crash remains:

start moe without a file argument

  1. o
  2. 1
  3. <ESC>
  4. v
  5. k
  6. d

This leads (by step 3) to a buffer consisting of

1
2 <CURSOR>1

And crashes with:

moe.nim(51)              moe
moe.nim(40)              main
normalmode.nim(538)      normalMode
editorstatus.nim(261)    resize
editorstatus.nim(211)    writeStatusBar
macros.nim(469)          writeStatusBarNormalModeInfo
gapbuffer.nim(87)        []
system.nim(3879)         failedAssertImpl
system.nim(3872)         raiseAssert
system.nim(2918)         sysFatal
Error: unhandled exception: /Users/jfondren/nim/moe/src/moepkg/gapbuffer.nim(87, 11) `0 <= index and index < gapBuffer.size` Gapbuffer: Invalid index. [AssertionError]

@fox0430 fox0430 merged commit 836354d into develop May 19, 2019
@fox0430 fox0430 deleted the fix#287 branch May 23, 2019 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants