ascii-boxes/boxes

Cisco Comment - Single line box not working correctly

J4bber opened this issue · 3 comments

Using latest Windows build on Notepad++:

Let’s say I have this in a text file

ipv4 access-list HOSTS
1 remark DC1 HOST
2 permit ipv4 host 192.168.1.1 any
3 remark DC2 HOST
4 permit ipv4 host 192.168.2.1 any
5 remark DC3 HOST
6 permit ipv4 host 192.168.3.1 any

Now, I want to “comment out” the remark and permit line for DC2 HOST. (Lines 3 and 4)

What I want to do is highlight those 2 rows, run box on it and get the following output

ipv4 access-list HOSTS
1 remark DC1 HOST
2 permit ipv4 host 192.168.12.90 any
! 3 remark DC2 HOST
! 4 permit ipv4 host 192.168.12.91 any
5 remark DC3 HOST
6 permit ipv4 host 192.168.16.90 any

However, seems like I am either missing something in my config, or box is behaving different than I expect… If I highlight those 2 lines and then run box on it I get this.

ipv4 access-list HOSTS
1 remark DC1 HOST
2 permit ipv4 host 192.168.12.90 any
! 3 remark DC2 HOST
! 4 permit ipv4 host 192.168.12.91 any
 
5 remark DC3 HOST
6 permit ipv4 host 192.168.16.90 any

What is causing the extra line?

Here is my box config for this

BOX cisco-comment
 
    sample
        ! text
    ends
 
    shapes {
       w("!")
    }
 
    elastic (w)
 
    padding {
                horizontal 1
    }
 
END cisco-comment

Here is the command that is executed in notepad++

NPP_CONSOLE 0  
cls
cmd.exe /c exit %RANDOM%
set tempfile = $(SYS.TEMP)\NppBoxes_$(EXITCODE).out.txt
set ascfile = $(SYS.TEMP)\NppBoxes_$(EXITCODE).in.txt
sel_saveto $(ascfile) :a
C:\boxes-1.2\boxes -d cisco-comment "$(ascfile)" "$(tempfile)"
sel_loadfrom $(tempfile)
cmd.exe /c del /f /q "$(tempfile)" "$(ascfile)"

Any help you can provide or explain what I am doing incorrectly would be greatly appreciated…

That's a tough one. I used your box definition (copy & paste), and your NppExec script, but can't reproduce the problem. 😞 At least not reliably. At one point, I also got an extra line, but now for the heck of it I can't reproduce it.
At least I'm reasonably sure that it's not a boxes problem, but rather a Notepad++ / NppExec problem.
If you leave out the delete command, can you find the extra line break in the output tempfile? (I couldn't ...)
Also, if you can, it would be interesting if the extra line is also in the input temp file.

Closed because of no feedback.
I assume the issue is resolved for you. If not, and you have time again to provide feedback, feel free to reopen anytime.

Possibly related to #57, for which data has been made available.