GithubHelp home page GithubHelp logo

shenzhen-solitaire.nvim's Issues

Crash 1

Occurred after clicking the green dragon button. Game was playable after clearing the error.

Perhaps the buffer was un-created somehow before write or was somehow under sized.

do local _let_11_ = pos local row = _let_11_["row"] local col = _let_11_["col"]
local _let_12_ = size local width = _let_12_["width"] local height = _let_12_["height"]
for r = 1, height do
for c = 1, width do
fbo[buffer_name][((r - 1) + row)][((c - 1) + col)] = f(r, c) end end end
return fbo end

shenzhen-solitaire.save.zip (drop .zip ext, added for upload)

2022-08-13_01-16

[Refuses to launch] `#0` not a valid color

Doesn't start the game on the both commands and the lua function.

Error executing Lua callback: .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:32: Vim:E
rror executing Lua callback: ...enzhen-solitaire.nvim/lua/shenzhen-solitaire/ui/view.lua:142: '#0'
is not a valid color
stack traceback:
        [C]: in function 'set_hl'
        ...enzhen-solitaire.nvim/lua/shenzhen-solitaire/ui/view.lua:142: in function 'new'
        ...hen-solitaire.nvim/lua/shenzhen-solitaire/ui/runtime.lua:43: in function <...hen-solitai
re.nvim/lua/shenzhen-solitaire/ui/runtime.lua:31>
stack traceback:
        [builtin#19]: at 0x7f6265cc0640
        [C]: in function 'cmd'
        .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:32: in function <.../share/nvim
/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>
stack traceback:
        [C]: in function 'cmd'
        .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:32: in function <.../share/nvim
/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>

Create empty buffer for the game

Currently if I run :ShenzhenSolitaireNewGame if draws the game in the currently opened buffer.
This creates a number of issues:
image

Also, it makes the buffer "modified", even though it was not. And if accidentally write the buffer, it overwrites it:

a.txt
 ╭─────╮   ╭─────╮   ╭─────╮             ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮
 │_    │   │_    │   │_    │     < Š     │_    │   │_    │   │_    │   │_    │
 │     │   │     │   │     │     < Ñ     │     │   │     │   │     │   │     │
 │     │   │     │   │     │     < Õ     │     │   │     │   │     │   │     │
 ╰─────╯   ╰─────╯   ╰─────╯             ╰─────╯   ╰─────╯   ╰─────╯   ╰─────╯
                                                                              
 ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮
 │1    │   │Ñ    │   │6    │   │9    │   │9    │   │7    │   │Ñ    │   │3    │
 ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮
 │Õ    │   │4    │   │Š    │   │Ñ    │   │Õ    │   │Õ    │   │2    │   │5    │
 ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮
 │5    │   │1    │   │Ñ    │   │3    │   │8    │   │8    │   │6    │   │ƒ    │
 ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮
 │4    │   │2    │   │4    │   │9    │   │6    │   │1    │   │Š    │   │3    │
 ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮   ╭─────╮
 │8    │   │2    │   │Š    │   │Õ    │   │7    │   │Š    │   │7    │   │5    │
 │     │   │     │   │     │   │     │   │     │   │     │   │     │   │     │
 │     │   │     │   │     │   │     │   │     │   │     │   │     │   │     │
 ╰─────╯   ╰─────╯   ╰─────╯   ╰─────╯   ╰─────╯   ╰─────╯   ╰─────╯   ╰─────╯
                                                                              
                                                                              
wins: 0 moves: 0                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              
                                                                              

Plus, I can't close the game without closing the buffer I was editing and if I have any unwritten changes to it, I can't write them anymore, so I have to close the buffer losing the unsaved changes.

The easiest solution would be to create a new empty buffer for the game not to interfere with the existing one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.