Code Monkey home page Code Monkey logo

Comments (19)

kristijanhusak avatar kristijanhusak commented on May 22, 2024

I'm not sure I understand. What you mean by this?

but it lost mapping from (DBUI_SaveQuery) to the real action

what is a real action?

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

I meant the command abstract map points to: :call <SNR>185_method('save_query')<CR>
image

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

Plug map points to the function call, and ,W points to the plug mapping. What's wrong in that?

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

Nothing wrong: the second image comes from the fresh running DBUI where mapping still exists. The first one illustrates the problem.

Maybe I can send you some additional information that can help.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

Ok, I get it. <Plug>(DBUI_SaveQuery) is not attached when viewing already saved query. It is available only for "new" queries. Would you expect it to work also for saved queries, or not to bind ,W when it is not available?

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

Independently of this bug ("keyboard->abstract" mapping is available also when "abstract->real" not) I would like to can save such query once again. We could then overwrite existing query, so the new filename (the old name by default) would be possible to edit in the save dialog.

On the other side, there is no problem to do it at the Vim level. With the recent fixes manually saved query buffers seems to behave in the same way as auto-generated query buffer (it require more tests to ensure).

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

I pushed a fix ~30 min ago that binds the mapping if you use custom g:db_ui_tmp_query_location. I guess we could always have the mapping.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

OK, I pulled this change to observe if the mapping will be then more persistent.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

Ok, let me know if you see anything strange.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

The problem still exists when I try to load (from the drawer) any saved query buffer that was loaded before DBUI started. Please run:

badd path/to/saved/query/buffer
DBUI

It occurs after load vim session with such buffer.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

bwipeout on such query buffer can be a workaround at the moment.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

Filetype is not recognized. Instead of bwipeout we can set ft=sql and DBUI is able to execute the query again.

Why not to add sql file extension (to any DBUI buffer file) by default (independently of the way of setting filetype)?

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

The problem still exists when I try to load (from the drawer) any saved query buffer that was loaded before DBUI started. Please run:

badd path/to/saved/query/buffer
DBUI

It occurs after load vim session with such buffer.

What happens if you do :DBUIFindBuffer after this?

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024
badd path/to/saved/query/buffer
DBUI
wincmd w
b 2

From this point I have two scenarios: with

DBUIFindBuffer

the buffer appears on Buffers list (named as its saved equivalent), but I have still not populated saved queries list (0 items, opening/closing does not refresh the list, all saved queries on the buffer list are displayed). After opening the buffer from Buffers list the query has still no sql filetype.

With opening database view in the drawer first, saved queries list is populated, but the rest is the same. The buffer behaves as non-sql buffer.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

I pushed some updates for DBUIFindBuffer. This was improved/fixed:

  1. SQL filetype is automatically set if file is not *.sql file.
  2. It automatically detects the database it needs to belong to, if buffer is a file in the folder of saved queries, no prompts like before.
  3. Autocmd for automatically execute on save is properly attached.

Please give it a test and let me know how it looks now.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

Preloaded buffers after unhiding it by the action on drawer or re-associating with DBUI by :DBUIFindBuffer are now usable as expected. It seems unlikely I will encounter a similar problem so we can close this issue and possibly open any new.

Thanks for investingating this behaviour.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

I missed one thing that was not fixed: the buffer activated with :DBUIFindBuffer is shown on Buffers list. Saved queries list and tables list still remain empty and even impossible to populate by keyboard action.

from vim-dadbod-ui.

kristijanhusak avatar kristijanhusak commented on May 22, 2024

Should be fixed now. You can always redraw the current database by pressing R while cursor is inside the database tree. This is now done automatically.

from vim-dadbod-ui.

przepompownia avatar przepompownia commented on May 22, 2024

Confirmed 🎉

from vim-dadbod-ui.

Related Issues (20)

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.