lokedhs / gnu-apl-mode

GNU APL mode for Emacs
GNU General Public License v3.0
94 stars 18 forks source link

Check for buffer ending with prompt #41

Open doyougnu opened 3 years ago

doyougnu commented 3 years ago

For whatever reason there is an extra newline on input to the interpreter:

With this example

⎕ ← ⊂data ← (1 2 3 4) (2 5 8 6) (8 6 2 3) (8 7 6 1)
data
2 4⍴⍳8 

calling gnu-apl-interactive-send-line or gnu-apl-interactive-send-region produces this:

      ╔═══════════════════════════════════════╗
║┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓║
║┃1 2 3 4┃ ┃2 5 8 6┃ ┃8 6 2 3┃ ┃8 7 6 1┃║
║┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛║
╚═══════════════════════════════════════╝
      ╔═══════╗
║1 2 3 4║
║5 6 7 8║
╚═══════╝

I believe the output should not have a tab character on the first line, like so:

╔═══════════════════════════════════════╗
║┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓ ┏→━━━━━━┓║
║┃1 2 3 4┃ ┃2 5 8 6┃ ┃8 6 2 3┃ ┃8 7 6 1┃║
║┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛║
╚═══════════════════════════════════════╝
╔═══════╗
║1 2 3 4║
║5 6 7 8║
╚═══════╝

Originally posted by @doyougnu in https://github.com/lokedhs/gnu-apl-mode/issues/40#issuecomment-912893127

See: https://github.com/lokedhs/gnu-apl-mode/pull/40#issuecomment-912910274