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

Map Indexing #120

Open
ColonelPanics opened this issue Mar 27, 2019 · 2 comments
Open

Map Indexing #120

ColonelPanics opened this issue Mar 27, 2019 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@ColonelPanics
Copy link
Member

The concern with using line numbers for the indexing of map key/val pairs is that a deletion of a line causes the indexing to shift.

Ideally it shouldn't be this easy to misalign the indexing.

Any ideas how we can better protect maps from this issue?

@ColonelPanics ColonelPanics added question Further information is requested bug Something isn't working labels Mar 27, 2019
@DavidMarchant
Copy link
Contributor

DavidMarchant commented Mar 27, 2019

The solution we've proposed is to have map height and width be compulsory (and not allow skipping should there not be any yet stored in the system). Then, instead of the current system where we use vim line numbers to correspond to the index, we would have vim pre-load with the necessary amount of numbers (height times width). This would both prevent the issue wherein accidentally deleting a line (using dd out of habit) would shift every other mapping by 1 and it would allow us to print warnings on close if unexpected data had been entered. (An unexpected amount of lines, indexes missing, 'corrupted' indexes, index out of order etc.)

The alternative solution is to again have height & width compulsory & simply warn if the number of lines at the end of the process is not equal to the expected value (width times height). This would also solve the accidental line deletion problem but in a less informative way.

@DavidMarchant
Copy link
Contributor

DavidMarchant commented Mar 28, 2019

Additionally: Enforcing the metadata as required will aid in overware integration down the line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants