mirror of
https://github.com/cjdenio/crossword.git
synced 2026-10-03 11:06:19 +00:00
jump backwards
This commit is contained in:
4 files changed
+1
-4
No files matched your search
@@ -6,5 +6,4 @@ todo
|
|||||||
- reveal grid/word
|
- reveal grid/word
|
||||||
- .puz checksums
|
- .puz checksums
|
||||||
- fix shift+enter / short+tab in other terminals
|
- fix shift+enter / short+tab in other terminals
|
||||||
- after entering letter, jump to next unfilled cell (even if it's backwards)
|
|
||||||
- clear grid
|
- clear grid
|
||||||
+1
-1
@@ -380,7 +380,7 @@ func (state *State) HandleInput(buffer []byte) (exited bool) {
|
|||||||
|
|
||||||
if !cellWasFilled {
|
if !cellWasFilled {
|
||||||
// jump to next unfilled cell in clue
|
// jump to next unfilled cell in clue
|
||||||
for x := i + 1; x < len(state.SelectedClue.Cells); x++ {
|
for x := (i + 1) % len(state.SelectedClue.Cells); x != i; x = ((x + 1) % len(state.SelectedClue.Cells)) {
|
||||||
if state.PuzzleState[state.SelectedClue.Cells[x]] == '-' {
|
if state.PuzzleState[state.SelectedClue.Cells[x]] == '-' {
|
||||||
state.SelectedCell = state.SelectedClue.Cells[x]
|
state.SelectedCell = state.SelectedClue.Cells[x]
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
state.SelectedClue = nil
|
state.SelectedClue = nil
|
||||||
state.SelectedCell = -1
|
state.SelectedCell = -1
|
||||||
state.Goodbye = true
|
|
||||||
fmt.Printf("\r\x1b[%dA", uiHeight)
|
fmt.Printf("\r\x1b[%dA", uiHeight)
|
||||||
fmt.Print("\x1b[J")
|
fmt.Print("\x1b[J")
|
||||||
state.RenderUI(os.Stdout)
|
state.RenderUI(os.Stdout)
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ func main() {
|
|||||||
if exited {
|
if exited {
|
||||||
state.SelectedClue = nil
|
state.SelectedClue = nil
|
||||||
state.SelectedCell = -1
|
state.SelectedCell = -1
|
||||||
state.Goodbye = true
|
|
||||||
fmt.Fprintf(s, "\r\x1b[%dA", uiHeight)
|
fmt.Fprintf(s, "\r\x1b[%dA", uiHeight)
|
||||||
fmt.Fprint(s, "\x1b[J")
|
fmt.Fprint(s, "\x1b[J")
|
||||||
state.RenderUI(s)
|
state.RenderUI(s)
|
||||||
|
|||||||
Reference in new issue
Block a user